db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kim Haase <Camilla.Ha...@Sun.COM>
Subject Re: Multiple database reboots in a single program?
Date Tue, 16 Oct 2007 17:04:03 GMT
Daniel John Debrunner wrote:
> Kim Haase wrote:
>> While working on a fix for DERBY-1823 (a documentation issue 
>> concerning user authentication and authorization), I've tried to write 
>> a sample Java program that connects to a database using the embedded 
>> driver, does some things, shuts it down, starts it up, does some more 
>> things, shuts it down again, and so on. I always get an error trying 
>> to connect to the database the second time, although I've followed the 
>> advice in "Shutting down the system" 
> 
> You are shutting down the complete Derby system, not just the database. 
> This means in order to reconnect to databases you need to restart Derby. 
> This is done by loading the JDBC driver again, you will need to actually 
> create an instance of the driver, since the class will already be loaded.

Thanks! That worked! The second time I did

String driver = "org.apache.derby.jdbc.EmbeddedDriver";
...
Class.forName(driver).newInstance();

And there was no exception.

In answer to your question, Bryan, I am using 10.3.1.4 (FCS, dated 
August 1) and JDK 1.5.0_09.

Much appreciated,
Kim

Mime
View raw message