Nevermind, problem solved.
Seems the issue was that when I was connected via embedded I was
supplying a path to the database, but when I connected via the server I
couldn't specify the path, and there was no database in the default
path. The solution was to set derby.system.home to where I wanted the
database to go, and then not specify a path in either connection type.
Mike.
Mike Verdone wrote:
Hi,
I'm trying to set up Derby in server mode, but for some reason I can't
connect to the server. The application I'm working on has two processes.
The one that starts first gets an embedded connection to the database
"arddb", and then spawns a server on localhost port 14502. The second
process then tries to connect to the server via localhost.
The database works fine in embedded mode. I can create tables and work
with data no problem. I am certain that the server has started-- for one
there are no error messages, and also the error message I get when I try
to connect is different than when I try to connect with no server
running. The error is this:
com.ibm.db2.jcc.c.DisconnectException: The application server rejected
establishment of the connection. An attempt was made to access a
database, arddb, which was not found.
How can arddb be not found when I'm working with it on the embedded
connection?
I've experimented with authentication settings but as far as I can tell
I don't even get that far. I created my own authenticator class that
logs a message and returns true. I installed it like this:
stmt.executeUpdate("CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(" +
"'derby.authentication.provider', "
+ "'com.pason.ard.db.DbUserAuthenticator')");
No messages are logged, so I don't think I've even hit the
authentication stage. The URL for the server connection is this:
jdbc:derby:net://localhost:14502/arddb
and I pass user and password as fields in a Properties object when I
connect.
I just don't understand why it won't let me connect. Any ideas?
Mike.