简体   繁体   中英

JDBC Mysql-connector in CLASSPATH, but not found

I included the lastest mysql-connector-java-5.1.30-bin.jar file for a Java project in Eclipse (Added External JAR, also in Run Configuration -> Classpath).

Also, I included it in my system-wide Classpath using the export command on Linux.

But when I run my program these warnings and errors keep coming up:

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

What do I need to do to make it work?

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

If your project is a Java Dynamic Web App then follow :

go to Properties of your project then select Deployment Assembly -> add -> Java Build Path Entries then add mysql-connector-java-5.1.30-bin.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM