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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| ||||
| 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 > |