db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: How does an application get access to JDBC implementation classes
Date Mon, 21 Nov 2005 09:12:46 GMT
"David W. Van Couvering" <David.Vancouvering@Sun.COM> writes:

> How do the instances of these get created?  It looks like the data
> sources are generally registered with JNDI using
> getObjectInstance(). But do we allow users to create new instances
> directly (e.g. "new ClientDataSource()")?  I noticed the constructor
> was public...
>
> It looks like Driver creates a new instance of itself when the class
> is loaded.  Do I have that right?

Yes, but...

> But again, we don't support someone
> saying "new ClientDriver()" directly, right?  Again, I noticed that
> this is currently a public method.

I think the constructor has to be public since
Class.forName("org.apache...").newInstance() is the recommended way to
load the Derby driver. Read this discussion for details:
http://www.mail-archive.com/derby-user@db.apache.org/msg01645.html

-- 
Knut Anders


Mime
View raw message