summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/postgresql/Connection.java
diff options
context:
space:
mode:
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);