Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
10.1.1.0
-
None
-
windows XP, JRE 1.5.0_04
Description
In contrast to EmbeddedDriver, a connection attribute create=true is not recognized when presented as a property in a Properties object.
As a workaround I append the attributes from the Properties object to the url string before invoking the connect() method: then a new database is created and a connection is established.
Next code fragment illustrates the bug and the workaround:
private static final ClientDriver clientDriver = new ClientDriver();
private Connection getClientConnection(String database,
Properties connectionProperties) throws SQLException {
try
catch (SQLException e) {
System.out.println("Try to connect with URL attributes");
StringBuffer sb = new StringBuffer();
for (Enumeration enu = connectionProperties.propertyNames(); enu
.hasMoreElements()
String connectionURL = "jdbc:derby://127.0.0.1:1527/" + database
+ sb.toString();
System.out.println("connectionURL: " + connectionURL);
Connection rv = clientDriver.connect(connectionURL,
connectionProperties);
System.out.println("Connection: " + rv);
System.out
.println("!!!!!!!!!!! seems a bug: Properties argument in ClientDriver.connect(String, Properties) has not been used");
return rv;
}
}
Attachments
Attachments
Issue Links
- is depended upon by
-
DERBY-559 With Network Client, user and password attriubtes specified in the url should not be sent to hte server with the RDBNAM or print with getURL
- Closed