JDBC driver (java.sql.Driver impl., version 03.03.00.04) does not handle correct the connect's "Properties" instance
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


JDBC driver (java.sql.Driver impl., version... Expand / Collapse
Author
Message
Posted 6/27/2007 5:59:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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.














Post #8000
Posted 1/30/2008 1:33:43 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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)
Post #10442
Posted 1/31/2008 11:50:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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.
Post #10461
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 2 ( 2 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 2:55am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.031. 7 queries. Compression Disabled.