CLASSPATH中的JDBC Mysql-connector,但未找到

时间:2014-05-08 12:00:00

标签: java mysql linux unix classpath

我在Eclipse中包含了最新的mysql-connector-java-5.1.30-bin.jar文件(添加了外部JAR,也在运行配置中 - > Classpath)。

另外,我使用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

我需要做些什么才能让它发挥作用?

2 个答案:

答案 0 :(得分:0)

Hy,我通过将驱动程序添加到tomcat服务器lib也解决了完全相同的问题

答案 1 :(得分:0)

如果您的项目是Java动态Web应用程序,请遵循:

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