Knut Anders Hatlen wrote:
I don't think you can set derby.drda.securityMechanism for a single
database. You would have to set it for the entire server process, either
by starting the Java process with -Dderby.drda.securityMechanism=XXX, or
by putting derby.drda.securityMechanism=XXX into derby.properties.
Ah right, that certainly would explain the problems I've been having. I
assume I could also use System.setProperty() before using
NetworkServerControl.start() the derby network server. I'm using Derby
inside a tomcat instance, but I want it to run in network server mode
rather than embedded mode so I can use external scripts for doing things
such as database backups, rather than having to do everything inside tomcat.
The NPE still looks like a derby bug though, irrespective of my mistake ;-)
I'm also a little confused on how to access a database once the network
server is is running, from inside the same JVM that contains the network
server. By mistake I forgot to change the URL from the one used by the
embedded driver:
db = DriverManager.getConnection("jdbc:derby:mydb", props);
to the one needed by the network driver
db = DriverManager.getConnection("jdbc:derby://localhost/mydb", props);
but the database still seemed to open OK, which is rather odd...
--
Alan Burlison
--