|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 6/27/2007 5:35:00 AM
Posts: 1,
Visits: 1
|
|
The driver's implementation of the method "Connection connect(String url, java.util.Properties info)" does not read correctly the properties stored in the "info" input parameter.
The driver ignores the "user" and the "password" properties (and probably the other properties too) if these properties are "default"/parent properties.
The following code fails to initialize the JDBC connection :
Class.forName("com.ncr.teradata.TeraDriver"); Properties parentProps = new Properties(); parentProps.setProperty("user","myUser"); parentProps.setProperty("password","myPassword"); Properties props = new Properties(parentProps); //the connection establishment fails because the driver fails to find the user and the password: Connection con = DriverManager.getConnection(dbUrl,props);
If parentProps are directly used, the connection creation succeeds !!!
This means that Teradata is not able to handle correctly the java.util.Properties objects ! Somewhere inside the driver, Hashtable methods are directly used (like get() or containsKey() ) and parent/default properties are ignored !! For getting a property or checking if it exists you should use only "getProperty()" ! Fragment from the java.util.Properties#getProperty(String key) javadoc: * If the key is not found in this property list, the default property list, * and its defaults, recursively, are then checked. The method returns * null if the property is not found.
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 1/31/2008 11:45:21 AM
Posts: 2,
Visits: 2
|
|
This issue corresponds to JDBC RFC DR 119654 -- support default Properties with DriverManager.getConnection(url, Properties)
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 1/31/2008 11:45:21 AM
Posts: 2,
Visits: 2
|
|
In case it wasn't clear, this RFC was just created and has not yet been scheduled for a particular Teradata JDBC Driver release.
|
|
|
|