summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/postgresql/Connection.java
diff options
context:
space:
mode:
authorMarc G. Fournier1998-02-09 03:22:41 +0000
committerMarc G. Fournier1998-02-09 03:22:41 +0000
commit2535fcde2a8a56159ed90b0debc05cf3be06ac35 (patch)
treed3fed126048e4002bab9b4a9e605e180913e678a /src/interfaces/jdbc/postgresql/Connection.java
parent83e637a99a3d8adbc0a4979cdf42303bbb8c7bb7 (diff)
From: Peter T Mount <[email protected]>
This patch fixes the following: * Fixes minor bug found in DatabaseMetaData.getTables() where it doesn't handle default table types. * It now reports an error if the client opens a database using properties, and either the user or password properties are missing. This should make the recent problem with Servlets easier to find. * Commented out obsolete property in Driver.getPropertyInfo()
Diffstat (limited to 'src/interfaces/jdbc/postgresql/Connection.java')
-rw-r--r--src/interfaces/jdbc/postgresql/Connection.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/interfaces/jdbc/postgresql/Connection.java b/src/interfaces/jdbc/postgresql/Connection.java
index 074a3d5579e..8dd980e2f06 100644
--- a/src/interfaces/jdbc/postgresql/Connection.java
+++ b/src/interfaces/jdbc/postgresql/Connection.java
@@ -139,6 +139,14 @@ public class Connection implements java.sql.Connection
{
//int len = STARTUP_LEN; // Length of a startup packet
+ // Throw an exception if the user or password properties are missing
+ // This occasionally occurs when the client uses the properties version
+ // of getConnection(), and is a common question on the email lists
+ if(info.getProperty("user")==null)
+ throw new SQLException("The user property is missing. It is mandatory.");
+ if(info.getProperty("password")==null)
+ throw new SQLException("The password property is missing. It is mandatory.")
+
this_driver = d;
this_url = new String(url);
PG_DATABASE = new String(database);