Ali Tahir
Ali Tahir

Reputation: 379

Eclipse Database Connection Driver Definition

I am using Eclipse Oxygen with Glassfish 5. I am Trying to connect to Derby. After selecting Derby from connection profile types I did next and my driver was empty (Specify a Driver and Connection Details) So I clicked on new driver definition I selected Derby Embedded JDBC Driver 10.2

Selected JAR from Glassfish

enter image description here

no host or port

In properties there is no localhost or Port. And the Connection URL does not has it either Connection Test is successful. I did changed the connection URL so it has port and Host but then Connection test failed. I'm learning Java EE and in tutorial it has host and port while i don't so i'm confused. Any Help ?

Upvotes: 0

Views: 1803

Answers (1)

Bryan Pendleton
Bryan Pendleton

Reputation: 16349

Host and port are used with the client driver, not with the embedded driver.

If your deployment approach is to deploy the Derby Network Server and then connect to it with one or more client applications that you are writing, then go back to the first step of your question and pick the Derby Client Driver, from derbyclient.jar.

By the way, I hope you are not really using Derby versions 10.1, 10.2, etc. Those are extremely old versions. Try to use Derby version 10.14 if you can, it's the most recent. You can download the latest Derby release from here: https://db.apache.org/derby/derby_downloads.html After you have downloaded Derby, and unzipped it into a folder on your laptop, load the latest 'derbyclient.jar' and 'derby.jar' into Eclipse so that you can work with the up-to-date JDBC drivers.

For some basic information about the difference between the client-server and embedded configurations of Derby, look here: https://db.apache.org/derby/docs/10.14/getstart/cgsquck70629.html

Many more details about the client-server configuration are explained here: https://db.apache.org/derby/docs/10.14/adminguide/index.html

While if you really do want to use the embedded Derby configuration, but were just confused about why you don't need a host and port for that configuration, try looking here: https://db.apache.org/derby/docs/10.14/devguide/cdevdvlp39409.html

Upvotes: 2

Related Questions