This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Derby embedded in Eclipse

 
Ranch Hand
Posts: 1397
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

when trying to connect with my new Derby installation in Eclipse I get the next error;

I have attached some images about the configuration.
derby.PNG
[Thumbnail for derby.PNG]
derby1.PNG
[Thumbnail for derby1.PNG]
derby2.PNG
[Thumbnail for derby2.PNG]
 
Sheriff
Posts: 6381
172
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Eclipse is this and what type (that is, Jakarta EE?)
 
Angus Ferguson
Ranch Hand
Posts: 1397
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 
Rancher
Posts: 4329
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working a bit from memory here, but doesn't the embedded driver work with files, rather than against a server (which that URL implies you are using)?
I'm pretty sure you should be using the ClientDriver instead for that.
 
Saloon Keeper
Posts: 21271
138
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Derby can be run in 2 different ways: as a stand-alone database or as a network-connected server.

In the first case, Derby is usually going to be embedded in the application, initialized by the application, and terminated with the application.

In the second case, Derby is operating as a completely independent process. And Eclipse is not going to launch it, so you would have to start and stop the Derby server yourself.

It appears you are trying to do the second case. You can use the netstat command to check to see if there really is a process (and we'll hope it's Derby) that is listening on tcp port 1527. If not, Derby was not started, or failed to start (in which case, check Derby's error logs).

 
Dave Tolls
Rancher
Posts: 4329
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But don't those two different ways have two different JDBC drivers?
One for embedded and one for servers?
 
Angus Ferguson
Ranch Hand
Posts: 1397
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It appears you are trying to do the second case


I am trying the first case it is an embedded DB into Eclipse.
It is not a process listening to the tcp 1527 port.#


notRunning.PNG
[Thumbnail for notRunning.PNG]
 
Angus Ferguson
Ranch Hand
Posts: 1397
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But don't those two different ways have two different JDBC drivers?
One for embedded and one for servers?


Yes, I am using a driver for embedded ones.
 
Tim Holloway
Saloon Keeper
Posts: 21271
138
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, there are two ways for "Eclipse" to connect to a database.

One is when an application is being developed using the Eclipse IDE and the application uses a database. Eclipse doesn't care about the database. When the application is run in a production environment, it's likely - even preferable - that Eclipse should be nowhere in sight.

The second case is if you have a Database Explorer plugin installed to Eclipse and you want the Database Explorer to connect to a database so that you can browse and maintain the database. Here again, Eclipse is not using the database. Only the plugin is. The plugin - as its name indicates is not an integral part of Eclipse.

Eclipse would never embed a copy of Derby in itself. Eclipse isn't in the database business. Anything in Eclipse that deals with databases - as I've indicated above, isn't actually Eclipse doing it.

And more the the point, I know of no Eclipse plug-in that launches a copy of Derby. Always when I've worked with Derby/JDBC in Eclipse, I've launched the Derby server externally. Or I'm running DBUnit, and DBUnit has invoked Derby for testing.
 
Angus Ferguson
Ranch Hand
Posts: 1397
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

One is when an application is being developed using the Eclipse IDE and the application uses a database


The goal I am trying to achieve it to generate a runnable Jar/exe which will launch the app  containing the database, the app is using to operate. So that the user will not have to care about installing any DB by himself.
 
Tim Holloway
Saloon Keeper
Posts: 21271
138
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case:

https://db.apache.org/derby/papers/DerbyTut/embedded_intro.html

Note that the JDBC URL used in that document does NOT specify a TCP/IP port number. That's because the embedded copy of Derby does not launch an independent server, but instead directly accesses the derby database data file(s).
 
We find this kind of rampant individuality very disturbing. But not this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!