aspose file tools*
The moose likes JDBC and the fly likes Properties for getConnection? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Properties for getConnection?" Watch "Properties for getConnection?" New topic
Author

Properties for getConnection?

Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
The documentation for java.sql.DriverManager (1.3) says that the getConnection() method has a signature that takes Properties. What I haven't found yet is any documentation that says what could be contained in that Properties set. (It lists it as an 'arbitrary set of string/value pairs.) Should I assume that that should be part of my driver's documentation? I'm looking for it for the MS SQL Server 2000 JDBC driver, but haven't yet found it.
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Hi Tina,
I used it and for my understanding its just overloaded from the

Properties is just a java.util.* class, which overwrites Hashtable ---> http://java.sun.com/j2se/1.3/docs/api/java/util/Properties.html
I can't imagine a situation where you won't put two Strings in it to establish the database-connection.
Axel
[ January 17, 2002: Message edited by: Axel Janssen ]
Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
I did end up finding my answer. . . Essentially, I had run across something that suggested I needed to pass in a property other than username or password (property was SelectMode for the SQL Server 2000 database), but I was having difficulty finding documentation for that property.
I'm using a connection pooling mechanism provided by some in-house libraries, so haven't had to deal with things in as-detailed a manner as I might have had to otherwise. Under the covers, the connections added to the connection pool are created by setting the username and password as part of the Properties parameter. I ended up passing in my SelectMode property as part of the URL string for the connection. (Documentation for that property did exist in a different MS JDBC 2000 document - I just was looking in the wrong place.)
Thanks!
Tina
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Properties for getConnection?