Yeah, the create=true has to go on the other side of the ":". Confusingly, there are two different sets of attributes/properties. If I remember correctly, one for Derby and one for the driver.

Jon

----- Original Message ----- From: "Mamta Satoor" <[EMAIL PROTECTED]>
To: "Derby Discussion" <[email protected]>; <[EMAIL PROTECTED]>
Sent: Wednesday, March 02, 2005 11:30 AM
Subject: Re: Creating DB with Derby Net Server



Hi Rick,

If you goto
http://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1871157
you will find good information on how database and server properties
get set on the url. From a quick look at your code, I think the jdbc
url is incorrect, and it should look like following
jdbc:derby:net://localhost:1527/demoDB;create=true:user=usr;password=pwd;retrieveMessagesFromServerOnGetMessage=true;

Mamta



On Wed, 02 Mar 2005 10:41:24 -0500, Rick Strong <[EMAIL PROTECTED]> wrote:
Greetings,

I am having difficulty creating a database using the net server.
I start the server programmatically in a standalong pgm like this:

****************************************************
NetworkServerControl server = new
NetworkServerControl(InetAddress.getByName("localhost"), port);
server.start(null);
****************************************************
In this case port == default: 1527; also, I have tried this using
"0.0.0.0" as the host address, same results.

Then attempt to create and connect to a database:

****************************************************
jdbc:derby:net://localhost:1527/demoDB:user=usr;password=pwd;create=true;retrieveMessagesFromServerOnGetMessage=true;
****************************************************

but this fails with the following error message:

****************************************************
com.ibm.db2.jcc.c.DisconnectException: The application server rejected
establishment of the connection.  An attempt was made to access a
database, demoDB, which was not found.
****************************************************

I should mention that it works fine with an existing DB, and also works
fine in embedded mode. Have I missed something RE: directives, security,
etc?

Thanks,

Rick Strong






Reply via email to