[英]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) .我下载了Core Apache Derby 数据库引擎的 jar,其中还包括嵌入式 JDBC 驱动程序 (10.9.1.0) 。 But that jar doesn't include the .class
file of ClientDriver
in the jdbc package.但是那个 jar 不包含ClientDriver
的.class
文件在 jdbc 包中。 Why is that?这是为什么? Where can i find this class file?我在哪里可以找到这个类文件? I need this file to connect to derby database from tomcat as the server.我需要这个文件作为服务器从 tomcat 连接到 derby 数据库。
Please provide the download link of the complete jar so that i get the required .class
file.请提供完整 jar 的下载链接,以便我获得所需的.class
文件。
OK: have you looked on the Apache Derby page:好的:你看过 Apache Derby 页面了吗:
Download db-derby-10.9.1.0-bin.zip下载 db-derby-10.9.1.0-bin.zip
It contains many files, including derby.jar
and derbyclient.jar
(along with much documentation).它包含许多文件,包括derby.jar
和derbyclient.jar
(以及许多文档)。
derbyclient.jar
contains our friend org.apache.derby.jdbc.ClientDriver.class
derbyclient.jar
包含我们的朋友org.apache.derby.jdbc.ClientDriver.class
@Paulsm4 is correct. @Paulsm4 是正确的。
But please keep in mind also that:但也请记住:
org.apache.derby.jdbc.ClientDriver org.apache.derby.jdbc.ClientDriver
which can be found inside derbyclient.jar is enough to just obtain connection to the running Derby DB server.可以在derbyclient.jar中找到它足以获取与正在运行的 Derby DB 服务器的连接。
But if you would like to create embedded (in memory) database when obtaining connection, then you have to use different jdbc driver:但是如果你想在获取连接时创建嵌入式(内存中)数据库,那么你必须使用不同的 jdbc 驱动程序:
org.apache.derby.jdbc.EmbeddedDriver org.apache.derby.jdbc.EmbeddedDriver
which can be found inside derby.jar .可以在derby.jar中找到。 Moreover, additional parameter create=true
has to be passed.此外,必须传递附加参数create=true
。 For example:例如:
<property name="javax.persistence.jdbc.url" value="jdbc:derby:myApp;databaseName=myApp;create=true" />
Hope it helps somebody.希望它能帮助别人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.