On 02.05.11 15:13, John English wrote:
I have a webapp which runs a networked Derby server. I want to be able
to access it from a separate app. The webapp starts the server from the
contextInitialized() method of a ServletContextListener:

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

which works fine. However, when I try to open a second connection with
IJ it gives me this response:

  ij> connect '/foo/db;dataEncryption=true;bootPassword=xyz';
  ERROR XJ040: Failed to start database '/foo/db', see the next
  exception for details.
  ERROR XSDB6: Another instance of Derby may have already booted the
  database C:foo\db.
  ij>

Is there something I'm missing here?

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.


Regards,
--
Kristian

[1] I'm assuming a connection to the database has already been made through the network server. If you connect with the embedded driver first, the connection through the network server will fail instead.


TIA,

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

Reply via email to