Paul French wrote:
Thanks Dan,
I had a look at the source code last night and noticed the EmbeddedActivator
instantiates a EmbeddedDataSource which by default uses java.sql.Driver.
I will probably write my own Activator instead. The problem now is the
DriverManager provides static methods to return connections where as we need
to deal with an instance of a javax.sql.DataSource to get connections. The
current Activator instantiates an EmbeddedDataSource and does not need to
retain a reference to it since connections are obtained via the static
DriverManager.getConnection method.
I don't see the current activator
(org.apache.derby.osgi.EmbeddedActivator) creating an EmbeddedDataSource??
Ideally current EmbeddedActivator needs to do both. I suppose it can check
for the existence of the java.sql.Driver class whether to use a
EmbeddedDataSource or EmbeddedSimpleDataSource. But since the
java.sql.DriverManager and javax.sql.DataSource provided connections in a
different way I'm not sure how to accommodate both?
Not sure what you mean here, the activator doesn't create connections.
Its only purpose is to start the core engine up, applications would
continue to get connections using whichever api they prefer, DataSource
(all) or DriverManager (jdbc 3, jdbc 4).
Really EmbeddedActivator should be booting the engine using internal
methods similar to how EmbeddedSimpleDataSource.findSriver() does, and
shutting down the engine using EmbeddedSimpleDataSource to get a
connection and not DriverManager.
Dan.