This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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!
It is sorta covered in the JavaRanch Style Guide.
subject: update driver
Similar Threads
Oracle9i Connectivity thru wsad5.o
jdbc previous/last/first/next methods
New to jdbc,please help
Oracle 9i thru WSAD5.0 Problem!!!!!
Servlet and Java class