简体   繁体   English

尝试设置Java DB:“未找到类:无法加载JDBC驱动程序org.apache.derby.jdbc.EmbeddedDriver”

[英]Trying to set up Java DB: “Class Not Found: JDBC driver org.apache.derby.jdbc.EmbeddedDriver could not be loaded”

I'm completely new to SQL, and I'm trying to set up a database to practice using it. 我对SQL完全陌生,我正在尝试建立一个数据库来练习使用它。

I'm on Windows 7. 我在Windows 7上。

I'm following Oracle's JDBC Basics tutorial ( http://docs.oracle.com/javase/tutorial/jdbc/basics/gettingstarted.html#step1 ) and have so far: 我正在关注Oracle的JDBC Basics教程( http://docs.oracle.com/javase/tutorial/jdbc/basics/gettingstarted.html#step1 ),并且到目前为止:

  1. Installed JDK (they say to install Java SE SDK, but as far as I can tell, JDK and Java SE SDK are more or less the same?) 已安装JDK(他们说要安装Java SE SDK,但据我所知JDK和Java SE SDK大致相同吗?)

  2. Installed Apache Ant. 安装了Apache Ant。

  3. Downloaded the sample code. 下载了示例代码。

  4. Modified the build.xml. 修改了build.xml。

  5. Modified the tutorial properties files. 修改了教程属性文件。

  6. Gone into Computer -> Properties -> Advanced System... -> Environment Variables and added PATH (C:\\Program\\Java\\jdk1.7.0_25\\bin;%ANT_HOME%/bin;C:\\Windows;C:\\Windows\\system32). 进入计算机->属性->高级系统...->环境变量并添加PATH(C:\\ Program \\ Java \\ jdk1.7.0_25 \\ bin;%ANT_HOME%/ bin; C:\\ Windows; C:\\ Windows \\ system32)。

  7. I go to cmd, change directory and run ant jar. 我转到cmd,更改目录并运行ant jar。 It complies successfully. 它符合要求。

  8. I run ant setup (which is supposed to create the database), and I get this error message: 我运行ant setup(应该用来创建数据库),并且收到以下错误消息:

Buildfile: C:\\Program\\Java\\JDBCTutorial\\build.xml 构建文件:C:\\ Program \\ Java \\ JDBCTutorial \\ build.xml

setup: 设定:

drop-tables: 下拉表:

BUILD FAILED C:\\Program\\Java\\JDBCTutorial\\build.xml:140: The following error occurred while executing this line: C:\\Program\\Java\\JDBCTutorial\\build.xml:83: Class Not Found: JDBC driver org.apache.derby.jdbc.EmbeddedDriver could not be loaded 失败的C:\\ Program \\ Java \\ JDBCTutorial \\ build.xml:140:执行此行时发生以下错误:C:\\ Program \\ Java \\ JDBCTutorial \\ build.xml:83:未找到类:JDBC驱动程序org.apache .derby.jdbc.EmbeddedDriver无法加载

Total time: 0 seconds 总时间:0秒

I don't know if I have the JDBC drivers - the tutorial says they're included in the download, but I don't know where to look for them to verify. 我不知道我是否有JDBC驱动程序-教程说它们包含在下载中,但是我不知道在哪里寻找它们进行验证。 I'm also thinking there might be something wrong with the PATH variable. 我还认为PATH变量可能有问题。 I've also seen people mention there could be problems with the classpath, but I don't know how to fix that. 我也看到有人提到类路径可能存在问题,但我不知道如何解决。

So you need to add the missing lib. 因此,您需要添加缺少的库。 You can download it here http://db.apache.org/derby/derby_downloads.html Then configure JAVADBDRIVER to point to the jar file. 您可以在此处下载它http://db.apache.org/derby/derby_downloads.html,然后将JAVADBDRIVER配置为指向jar文件。

JAVADBDRIVER The full path name of your Java DB driver. JAVADBDRIVER Java DB驱动程序的完整路径名。 This is typically /lib/derby.jar. 这通常是/lib/derby.jar。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “找不到类:JDBC 驱动程序 org.apache.derby.jdbc.EmbeddedDriver 无法加载”尽管已在类路径中包含所需的 JARs - "Class Not Found: JDBC driver org.apache.derby.jdbc.EmbeddedDriver could not be loaded" despite having included required JARs in classpath 配置错误。 连接到数据库时找不到类 [org.apache.derby.jdbc.EmbeddedDriver] - Configuration error. Class [org.apache.derby.jdbc.EmbeddedDriver] not found while connecting to DB java.lang.ClassNotFoundException:org.apache.derby.jdbc.EmbeddedDriver - java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver Apache Derby 10.15.* - java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver - Apache Derby 10.15.* - java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver 尝试将JPA与Derby一起使用时ClassNotFoundException:org.apache.derby.jdbc.EmbeddedDriver - ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver when trying to use JPA with Derby Derby 在使用 Maven 时给出 ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver - Derby gives ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver while using Maven 未找到类[org.apache.derby.jdbc.ClientDriver]。 尝试连接到db时 - Class [org.apache.derby.jdbc.ClientDriver] not found. When trying to connect to db java-找不到类[org.apache.derby.jdbc.ClientDriver] - java - Class [org.apache.derby.jdbc.ClientDriver] not found JDBC 未找到 Derby 驱动程序 - JDBC Derby driver not found 找不到适用于jdbc:derby的驱动程序: <db-name> Linux / Ubuntu上带有Java DB的JDBC错误 - No suitable driver found for jdbc:derby:<db-name> error on JDBC with Java DB on Linux/Ubuntu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM