|
2 | 2 |
|
3 | 3 | importjava.sql.*; |
4 | 4 | importjunit.framework.TestCase; |
| 5 | +importjava.util.Properties; |
5 | 6 |
|
6 | 7 | /* |
7 | 8 | * Utility class for JDBC tests |
@@ -61,10 +62,21 @@ public static String getPassword() |
61 | 62 | */ |
62 | 63 | publicstaticjava.sql.ConnectionopenDB() |
63 | 64 | { |
| 65 | +returnopenDB(newProperties()); |
| 66 | +} |
| 67 | + |
| 68 | +/* |
| 69 | + * Helper - opens a connection with the allowance for passing |
| 70 | + * additional parameters, like "compatible". |
| 71 | + */ |
| 72 | +publicstaticjava.sql.ConnectionopenDB(Propertiesprops) |
| 73 | +{ |
| 74 | +props.setProperty("user",getUser()); |
| 75 | +props.setProperty("password",getPassword()); |
64 | 76 | try |
65 | 77 | { |
66 | 78 | Class.forName("org.postgresql.Driver"); |
67 | | -returnjava.sql.DriverManager.getConnection(getURL(),getUser(),getPassword()); |
| 79 | +returnjava.sql.DriverManager.getConnection(getURL(),props); |
68 | 80 | } |
69 | 81 | catch (ClassNotFoundExceptionex) |
70 | 82 | { |
|