This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes update driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "update driver" Watch "update driver" New topic
Author

update driver

Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315

can anything tell me whether i can simply update the driver by this? Thanks!
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

It is not recommended to manually register drivers, it is better to allow them to load themselves when the Class is loaded as happens with Class.forName()
The source for the DriverManager is available with the JDK, and if you have a look at it, it doesn't manage drivers well since manual loading can produce duplicate entries.
My answer is: maybe, but I'd have a look at the source to make sure. Normally I wouldn't recommend looking into the source code to solve a problem, but the behaviour is not specified in the API
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
I'm sold on the idea of using DataSource object methods to obtain Connections. I recommend checking out the oracle.jdbc.pool.OracleDataSource class to see if that isn't easier to deal with.
Instantiate a DataSource object and use its "setter" methods to specify driver type ("thin"?), database url, user, password, etc... then call getConnection().


Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: update driver
 
Similar Threads
jdbc previous/last/first/next methods
New to jdbc,please help
Oracle 9i thru WSAD5.0 Problem!!!!!
Oracle9i Connectivity thru wsad5.o
Servlet and Java class