Thanks, Dan. Can you point me to something that talks more about what
it means to be a "valid OSGi bundle?"
Lance, do you have any information on how a driver is loaded in JDBC4
using the service provider mechanism?
Thanks,
David
Daniel John Debrunner wrote:
David W. Van Couvering wrote:
OK, I think I may have the answer to my question. Looking at the JDBC
API, here is what I can figure out. There are the following Connection
factories that a JDBC implementation must provide:
Driver
DataSource
XADataSource
ConnectionPoolDataSource
Next question:
How do the instances of these get created?
In addition to the other ways already discussed, JDBC 4.0 is adding the
automatic registration of JDBC drivers using the "Java Standard Edition
Service Provider mechanism". Thus in JDBC 4.0, this is valid JDBC code.
public static void main(String[] args)
{
// no need to load a driver
Connection conn = DriverManager.getConnection("jdbc:derby:cs");
}
This may have an impact on those looking at class loaders to support
multiple Derby drivers. I didn't find (in a very quick look) any
information on Java SE Service Provider, and how it handles class loading.
Also derby.jar is a valid OSGi bundle, this may also have some impact on
those looking at class loaders for multiple multi-version derby instances.
And, in fact the code above is valid in JDBC 2.0 and 3.0. If the driver
class name is in the system property "jdbc.drivers", then it will be
loaded automatically. Again I haven't looked to see how this handles
class loaders.
Dan.
begin:vcard
fn:David W Van Couvering
n:Van Couvering;David W
org:Sun Microsystems, Inc.;Database Technology Group
email;internet:[EMAIL PROTECTED]
title:Senior Staff Software Engineer
tel;work:510-550-6819
tel;cell:510-684-7281
x-mozilla-html:TRUE
version:2.1
end:vcard