Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where is org.apache.derby.jdbc.ClientDriver?

I downloaded the jar of Core Apache Derby database engine, which also includes the embedded JDBC driver (10.9.1.0). But that jar doesn't include the .class file of ClientDriver in the jdbc package. Why is that ? Where can i find this class file ? I need this file to connect to derby database from tomcat as the server.

Please provide the download link of the complete jar so that i get the required .class file.

like image 524
saplingPro Avatar asked Jul 18 '12 03:07

saplingPro


People also ask

How do I access Derby database?

If you want to connect to a Derby database which is running in server mode then you can use the following command. connect 'jdbc:derby://localhost:1527/c:\temp\db\FAQ\db;create=true';

What is Derby in JDBC?

Derby consists of both the database engine and an embedded JDBC driver. Applications use JDBC to interact with a database. Applications running on JDK 1.5 or earlier, must load the driver in order to work with the database. In an embedded environment, loading the driver also starts Derby.

How do I install a Derby database in Windows 10?

Download the Derby database software from the Apache website at http://db.apache.org/derby/derby_downloads.html. Extract the files into the directory that you have created for the Derby database. For example: C:\Derby. Set the DERBY_HOME system variable to the location of your Derby installation.


2 Answers

OK: have you looked on the Apache Derby page:

  • http://db.apache.org/derby/releases/release-10.9.1.0.cgi

Download db-derby-10.9.1.0-bin.zip

It contains many files, including derby.jar and derbyclient.jar (along with much documentation).

derbyclient.jar contains our friend org.apache.derby.jdbc.ClientDriver.class

like image 84
paulsm4 Avatar answered Oct 15 '22 19:10

paulsm4


@Paulsm4 is correct.
But please keep in mind also that:

org.apache.derby.jdbc.ClientDriver

which can be found inside derbyclient.jar is enough to just obtain connection to the running Derby DB server.

But if you would like to create embedded (in memory) database when obtaining connection, then you have to use different jdbc driver:

org.apache.derby.jdbc.EmbeddedDriver

which can be found inside derby.jar. Moreover, additional parameter create=true has to be passed. For example:

<property name="javax.persistence.jdbc.url" value="jdbc:derby:myApp;databaseName=myApp;create=true" /> 

Hope it helps somebody.

like image 36
G. Demecki Avatar answered Oct 15 '22 19:10

G. Demecki