Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

update driver

 
Jackie Wang
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

can anything tell me whether i can simply update the driver by this? Thanks!
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic