NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Deploy Java Desktop Database Application with Java Derby

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
ViGiLnT
Posted via mailing list.





PostPosted: Sat Oct 18, 2008 4:35 pm    Post subject: Deploy Java Desktop Database Application with Java Derby Reply with quote

Hi!

I've been looking around the web for this answer, but I've not been
successful .

I'm developing a Java Desktop Application that connects with a Java Derby
Database, wich I want to be embedded.

I've deployed the app, creating the .jar file, but as soon as I shut down
Netbeans, I can't connect to the database. It throws this error, amongst
other:

"Error connecting to server localhost on port 1527 with message Connection
Refused: connect."

I've already seen some threads where someone said to start the Derby server
with the Derbynet.jar, wich I did, but then it throws another error:

"The connection was refused because the database donatodb was not found"

Where "donatodb" is the database wich I created.

How can I make this work?
--
View this message in context: http://www.nabble.com/Deploy-Java-Desktop-Database-Application-with-Java-Derby-tp20048435p20048435.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
Witold Szczerba
Posted via mailing list.





PostPosted: Sat Oct 18, 2008 5:54 pm    Post subject: Deploy Java Desktop Database Application with Java Derby Reply with quote

Consider using embedded version of Derby driver for deployment. In
this mode, there is no separate database server process, so you do not
have to start separate process before your application. In my case,
the files structure was like this in dist folder:

[lib]
[applicationDB]
application.jar

In 'lib' folder, there are every libraries my application needs
including derby libs, applicationDB is derby database folder. So, in
this case database is inside application main directory. I connect to
that database using following URL:

jdbc:derby:applicationDB

The JDBC driver is:
org.apache.derby.jdbc.EmbeddedDriver

Regards,
Witold Szczerba

2008/10/18 ViGiLnT <address-removed>:
Quote:

Hi!

I've been looking around the web for this answer, but I've not been
successful .

I'm developing a Java Desktop Application that connects with a Java Derby
Database, wich I want to be embedded.

I've deployed the app, creating the .jar file, but as soon as I shut down
Netbeans, I can't connect to the database. It throws this error, amongst
other:

"Error connecting to server localhost on port 1527 with message Connection
Refused: connect."

I've already seen some threads where someone said to start the Derby server
with the Derbynet.jar, wich I did, but then it throws another error:

"The connection was refused because the database donatodb was not found"

Where "donatodb" is the database wich I created.

How can I make this work?
--
View this message in context: http://www.nabble.com/Deploy-Java-Desktop-Database-Application-with-Java-Derby-tp20048435p20048435.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.

Back to top
ViGiLnT
Posted via mailing list.





PostPosted: Sat Oct 18, 2008 6:43 pm    Post subject: Deploy Java Desktop Database Application with Java Derby Reply with quote

Thanks for the reply.

From the start I wanted to use the embedded driver, didnt realize i wasn't
using it.

But using this driver I cant create a database. This is what I'm trying to
do:

http://img122.imageshack.us/my.php?image=derbyuy5.png

How can I do it? This must be a really dumb question... :P


Witold Szczerba wrote:
Quote:

Consider using embedded version of Derby driver for deployment. In
this mode, there is no separate database server process, so you do not
have to start separate process before your application. In my case,
the files structure was like this in dist folder:

[lib]
[applicationDB]
application.jar

In 'lib' folder, there are every libraries my application needs
including derby libs, applicationDB is derby database folder. So, in
this case database is inside application main directory. I connect to
that database using following URL:

jdbc:derby:applicationDB

The JDBC driver is:
org.apache.derby.jdbc.EmbeddedDriver

Regards,
Witold Szczerba

2008/10/18 ViGiLnT <address-removed>:
Quote:

Hi!

I've been looking around the web for this answer, but I've not been
successful .

I'm developing a Java Desktop Application that connects with a Java Derby
Database, wich I want to be embedded.

I've deployed the app, creating the .jar file, but as soon as I shut down
Netbeans, I can't connect to the database. It throws this error, amongst
other:

"Error connecting to server localhost on port 1527 with message
Connection
Refused: connect."

I've already seen some threads where someone said to start the Derby
server
with the Derbynet.jar, wich I did, but then it throws another error:

"The connection was refused because the database donatodb was not found"

Where "donatodb" is the database wich I created.

How can I make this work?
--
View this message in context:
http://www.nabble.com/Deploy-Java-Desktop-Database-Application-with-Java-Derby-tp20048435p20048435.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.





--
View this message in context: http://www.nabble.com/Deploy-Java-Desktop-Database-Application-with-Java-Derby-tp20048435p20049516.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
Dave_Curry
Posted via mailing list.





PostPosted: Sun Oct 19, 2008 1:38 pm    Post subject: Deploy Java Desktop Database Application with Java Derby Reply with quote

I've found that I have to copy the database folder, "donatodb" in your case,
to the same folder as the jar file, and keep it with the jar file whenever I
copy/move it. That's for embedded dbs only.

For networked dbs, JDBC keeps track of the location, so no copying is
needed. Unless, of course, you deploy to a server - then, of course, you
must deploy the db also.

HTH,
Dave



ViGiLnT wrote:
Quote:

Hi!

I've been looking around the web for this answer, but I've not been
successful .

I'm developing a Java Desktop Application that connects with a Java Derby
Database, wich I want to be embedded.

I've deployed the app, creating the .jar file, but as soon as I shut down
Netbeans, I can't connect to the database. It throws this error, amongst
other:

"Error connecting to server localhost on port 1527 with message Connection
Refused: connect."

I've already seen some threads where someone said to start the Derby
server with the Derbynet.jar, wich I did, but then it throws another
error:

"The connection was refused because the database donatodb was not found"

Where "donatodb" is the database wich I created.

How can I make this work?


--
View this message in context: http://www.nabble.com/Deploy-Java-Desktop-Database-Application-with-Java-Derby-tp20048435p20056197.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
ViGiLnT
Posted via mailing list.





PostPosted: Sun Oct 19, 2008 2:21 pm    Post subject: Deploy Java Desktop Database Application with Java Derby Reply with quote

Thanks for the reply. I've already succeeded at deploying the app with derby
embedded.

I couldn't create a embedded database, but I just had to add "create=true"
to connect string.

Thanks everyone.



Dave_Curry wrote:
Quote:

I've found that I have to copy the database folder, "donatodb" in your
case, to the same folder as the jar file, and keep it with the jar file
whenever I copy/move it. That's for embedded dbs only.

For networked dbs, JDBC keeps track of the location, so no copying is
needed. Unless, of course, you deploy to a server - then, of course, you
must deploy the db also.

HTH,
Dave



ViGiLnT wrote:
Quote:

Hi!

I've been looking around the web for this answer, but I've not been
successful .

I'm developing a Java Desktop Application that connects with a Java Derby
Database, wich I want to be embedded.

I've deployed the app, creating the .jar file, but as soon as I shut down
Netbeans, I can't connect to the database. It throws this error, amongst
other:

"Error connecting to server localhost on port 1527 with message
Connection Refused: connect."

I've already seen some threads where someone said to start the Derby
server with the Derbynet.jar, wich I did, but then it throws another
error:

"The connection was refused because the database donatodb was not found"

Where "donatodb" is the database wich I created.

How can I make this work?




--
View this message in context: http://www.nabble.com/Deploy-Java-Desktop-Database-Application-with-Java-Derby-tp20048435p20056611.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
priyanshu90



Joined: 25 Feb 2009
Posts: 1
Location: ahmedabad

PostPosted: Wed Feb 25, 2009 5:25 pm    Post subject: Reply with quote

hi
actually i have been going through same problem as yours..
the soln is quite simple..
here, actually 1527 port is ready to accept connections although it couldn't find a database of your name
y???

just give the absolute path of your database and not the relative path like :
jdbc:derby://localhost:1527/C:/Documents and Settings/Admin/.netbeans-derby/<your db name>

it wud work fine, my gurantee...

regards
priyanshu
Back to top
darkoks



Joined: 23 Apr 2010
Posts: 3

PostPosted: Fri Apr 23, 2010 10:30 pm    Post subject: Re: Deploy Java Desktop Database Application with Java Derby Reply with quote

Witold Szczerba wrote:
Consider using embedded version of Derby driver for deployment. In
this mode, there is no separate database server process, so you do not
have to start separate process before your application. In my case,
the files structure was like this in dist folder:

[lib]
[applicationDB]
application.jar

In 'lib' folder, there are every libraries my application needs
including derby libs, applicationDB is derby database folder. So, in
this case database is inside application main directory. I connect to
that database using following URL:

jdbc:derby:applicationDB

The JDBC driver is:
org.apache.derby.jdbc.EmbeddedDriver

Regards,
Witold Szczerba

2008/10/18 ViGiLnT <address-removed>:
Quote:

Hi!

I've been looking around the web for this answer, but I've not been
successful .

I'm developing a Java Desktop Application that connects with a Java Derby
Database, wich I want to be embedded.

I've deployed the app, creating the .jar file, but as soon as I shut down
Netbeans, I can't connect to the database. It throws this error, amongst
other:

"Error connecting to server localhost on port 1527 with message Connection
Refused: connect."

I've already seen some threads where someone said to start the Derby server
with the Derbynet.jar, wich I did, but then it throws another error:

"The connection was refused because the database donatodb was not found"

Where "donatodb" is the database wich I created.

How can I make this work?
--
View this message in context: http://www.nabble.com/Deploy-Java-Desktop-Database-Application-with-Java-Derby-tp20048435p20048435.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo