patch for new OID74Test
authorDave Cramer
Thu, 18 Dec 2003 04:17:17 +0000 (04:17 +0000)
committerDave Cramer
Thu, 18 Dec 2003 04:17:17 +0000 (04:17 +0000)
src/interfaces/jdbc/org/postgresql/test/TestUtil.java

index 6b139435a54371fa3f0a1ef3fd6841ead5cfe700..9ef0c7d899fda4e751d888fd7c92ea43bd2a26f3 100644 (file)
@@ -2,6 +2,7 @@ package org.postgresql.test;
 
 import java.sql.*;
 import junit.framework.TestCase;
+import java.util.Properties;
 
 /*
  * Utility class for JDBC tests
@@ -61,10 +62,21 @@ public class TestUtil
     */
    public static java.sql.Connection openDB()
    {
+       return openDB(new Properties());
+   }
+
+   /*
+    * Helper - opens a connection with the allowance for passing
+    * additional parameters, like "compatible".
+    */
+   public static java.sql.Connection openDB(Properties props)
+   {
+       props.setProperty("user",getUser());
+       props.setProperty("password",getPassword());
        try
        {
            Class.forName("org.postgresql.Driver");
-           return java.sql.DriverManager.getConnection(getURL(), getUser(), getPassword());
+           return java.sql.DriverManager.getConnection(getURL(), props);
        }
        catch (ClassNotFoundException ex)
        {