我在Eclipse中添加了Java项目的最新mysql-connector-java-5.1.30-bin.jar文件(添加了外部JAR,也在“运行配置->类路径”中)。

另外,我在Linux上使用export命令将其包含在系统范围的Classpath中。

但是,当我运行程序时,这些警告和错误不断出现:

Trying to add database driver (JDBC): RmiJdbc.RJDriver - Warning, not in CLASSPATH?

Trying to add database driver (JDBC): jdbc.idbDriver - Warning, not in CLASSPATH?

Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Warning, not in CLASSPATH?

Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Warning, not in CLASSPATH?

Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:     Communications link failure


我需要做些什么才能使其正常工作?

最佳答案

如果您的项目是Java Dynamic Web App,请遵循:

然后转到项目的Properties
选择Deployment Assembly-> add-> Java Build Path Entries,然后添加mysql-connector-java-5.1.30-bin.jar

关于java - CLASSPATH中的JDBC Mysql-connector,但未找到,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23541111/

10-10 11:16
查看更多