11

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.

saplingPro
  • 20,769
  • 53
  • 137
  • 195
  • Uh, what makes you think we can just magically produce download links? Did you try this thing called "google"? It helps you find things on the web... – Marc B Jul 18 '12 at 03:37
  • Are you sure you can't use ["org.apache.derby.jdbc.EmbeddedDriver"](http://db.apache.org/derby/integrate/DerbyTomcat5512JPetStor.html)? – paulsm4 Jul 18 '12 at 03:38

2 Answers2

17

OK: have you looked on the Apache Derby page:

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

Hardik Mishra
  • 14,779
  • 9
  • 61
  • 96
paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • 5
    I don't know when, but in the db-derby-10.15.2.0-bin the derbyclient.jar doesn't contains the org.apache.derby.jdbc.ClientDriver.class. I found it in the derbytools.jar – Grégory Jun 05 '20 at 15:59
  • @Gregory: thank you for the update. The "when" was "Derby 10.15". Now, in order to use the Derby client driver with Derby 10.15, you need all three of derbyclient.jar, derbyshared.jar, and derbytools.jar. Sigh... Look [here](https://stackoverflow.com/a/57221011/421195) for details. – paulsm4 Jun 05 '20 at 20:15
9

@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.

G. Demecki
  • 10,145
  • 3
  • 58
  • 58