You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Rick Strong <rs...@panix.com> on 2005/03/02 16:41:24 UTC

Creating DB with Derby Net Server

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





Re: Creating DB with Derby Net Server

Posted by "Jean T. Anderson" <jt...@bristowhill.com>.
Mamta Satoor wrote:
> Hi Rick,
> 
> If you goto 
> http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=derby-dev@db.apache.org&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
> <snip />

The URL Mamta posted works right now, but here's the corresponding 
mod_mbox URL:
http://mail-archives.eu.apache.org/mod_mbox/db-derby-dev/200409.mbox/%3c4138B3C1.5090008@Sourcery.Org%3e

Eyebrowse email archives use their own generated IDs, which aren't 
persistent and are now corrupt. Apache is talking about perhaps 
rebuilding the archives in mid-March. A rebuild will change all 
eyebrowse IDs, so these older URLs will no longer work. For example, the 
msgId=1871157 in the eyebrowse URL above will no longer be valid.

I recommend posting mod_mbox URLs instead because they use persistent ids.

The http://incubator.apache.org/derby/derby_mail.html page includes 
links to the mod_mbox archives.

-jean

Re: Creating DB with Derby Net Server

Posted by Jonathan Eric Miller <je...@uchicago.edu>.
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" <ms...@gmail.com>
To: "Derby Discussion" <de...@db.apache.org>; <rs...@panix.com>
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/ReadMsg?listName=derby-dev@db.apache.org&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 <rs...@panix.com> 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
>>
>>
> 


Re: Creating DB with Derby Net Server

Posted by Mamta Satoor <ms...@gmail.com>.
Hi Rick,

If you goto 
http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=derby-dev@db.apache.org&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 <rs...@panix.com> 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
> 
>