db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John English <john.fore...@gmail.com>
Subject Re: Derby network server
Date Tue, 03 May 2011 12:30:04 GMT
On 02/05/2011 20:53, Kristian Waagan wrote:
> Hi John,
>
> Looks to me like you are trying to access, or more specifically boot,
> the database with the embedded driver. This won't work since the network
> server has already booted the database [1].
> The only change required should be to add the host name to the
> connection URL (localhost?), i.e. something like
> "jdbc:derby://localhost[:port]/db[;attributes]". You will then get two
> (or more) connections to the database, all using the client driver and
> going through the network server.

Thanks for this (silly me!), but unfortunately it doesn't fix it.

In the webapp:

   server = new NetworkServerControl();
   server.start(null);

and then later:

   conn = DriverManager.getConnection(
               "jdbc:derby://127.0.0.1:1527/foo/db;dataEncryption=true"
               + ";bootPassword=xyz",
               "app", "app");

which works fine -- the webapp accesses the DB and all is well.

But then I try connecting from IJ, and this is what I get:

ij> connect '//127.0.0.1:1527/foo/db;dataEncryption=true;bootPassword=xyz';
ERROR XJ040: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ040, SQLERRMC:
Failed to start database 'foo/db' with class loader
WebAppClassLoader@Foo, see the next exception for details.::
SQLSTATE: XSDB6Another instance of Derby may have already booted
the database C:\Users\JE\Documents\Projects\foo\db.
ij>

So I'm still stuck... Any more ideas what I'm doing wrong here?

TIA,

------------------------------------------------------------------------
  John English | My old University of Brighton home page is still here:
               | http://www.it.brighton.ac.uk/staff/je
------------------------------------------------------------------------

Mime
View raw message