Unix Technical Forum

Server side default JDBC driver

This is a discussion on Server side default JDBC driver within the DB2 forums, part of the Database Server Software category; --> Happy Christmas to all (who celebrate)! It's still not clear to me... when in a java stored procedure it ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 03:31 AM
eugene@profitlogic.com
 
Posts: n/a
Default Server side default JDBC driver

Happy Christmas to all (who celebrate)!

It's still not clear to me... when in a java stored procedure it says:
conn = DriverManager.getConnection("jdbc:default:connecti on");
what driver DB2 database manager loads? Is it configurable on the
database server side so I could switch between different JDBC driver
types, i.e. 2 and 4?
I am on DB2 8.1.4 AIX and Linux.

Thanks,
-Eugene

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 03:31 AM
Joe Weinstein
 
Posts: n/a
Default Re: Server side default JDBC driver



eugene@profitlogic.com wrote:

> Happy Christmas to all (who celebrate)!
>
> It's still not clear to me... when in a java stored procedure it says:
> conn = DriverManager.getConnection("jdbc:default:connecti on");
> what driver DB2 database manager loads? Is it configurable on the
> database server side so I could switch between different JDBC driver
> types, i.e. 2 and 4?
> I am on DB2 8.1.4 AIX and Linux.


Hi. That actually depends on DriverManager, and what order drivers were registered.
The DriverManager simply, blindly passes your URL and properties to every driver
that has been registered with it, until it finds one that doesn't throw an exception
and does return a connection. That's what you get back. So if multiple drivers
accept the same URL, whichever is loaded/tried first by DriverManager will always
be the one that returns your connection. You can determine which it is by calling
DriverManager.getDrivers(), which will give an enumeration of all loaded drivers.
You can step through that list, and call Driver.acceptsURL() to find which one
does accept your URL. Then just print out the driver's class name to get your answer.
Joe Weinstein at BEA

>
> Thanks,
> -Eugene
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:08 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com