db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew McIntyre" <mcintyr...@gmail.com>
Subject Re: Accessing embedded Derby in forked Maven2 build
Date Mon, 13 Mar 2006 20:43:39 GMT
On 3/13/06, Randy Watler <watler@wispertel.net> wrote:
>
> What I'd really like to have is an SQL statement I can execute to
> perform the shutdown. Barring that, finding a way to avoid throwing the
> connect SQLException might also work. A Derby Ant task to perform the
> shutdown would be very handy as well if it is available in the Derby
> distribution. Are any of these or other options available that I might try?

There isn't currently a Derby Ant task, but feel free to contribute
one if you have the time. I recently wanted to do the same thing for
an Ant build.xml that builds a sample database for Derby (see
DERBY-422 in JIRA), and I used ij:

    <java classname="org.apache.derby.tools.ij"
          append="true"
          failonerror="true"
          dir="." fork="true">
      <classpath>
        <pathelement path="${lib.dir}/derby.jar"/>
        <pathelement path="${lib.dir}/derbytools.jar"/>
      </classpath>
      <arg value="shutdown.sql"/>
    </java>

Where the contents of shutdown.sql is:

connect 'jdbc:derby:toursdb';
connect 'jdbc:derby:toursdb;shutdown=true';

Would that do the trick?

andrew

Mime
View raw message