[英]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). 我在Eclipse中添加了Java项目的最新mysql-connector-java-5.1.30-bin.jar文件(添加了外部JAR,也在“运行配置->类路径”中)。
Also, I included it in my system-wide Classpath using the export command on Linux. 另外,我在Linux上使用export命令将其包含在系统范围的Classpath中。
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 : 如果您的项目是Java Dynamic Web App,请遵循:
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
转到项目的
Properties
,然后选择Deployment Assembly
-> add
-> Java Build Path Entries
然后添加mysql-connector-java-5.1.30-bin.jar
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.