File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes update driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "update driver" Watch "update driver" New topic

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

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:
subject: update driver
It's not a secret anymore!