Java Connecting to remote MySQL database

后端 未结 3 1020
梦如初夏
梦如初夏 2021-01-16 00:17

Hey guys im trying to connect to my remote mysql database and my code gives me this error:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.ne         


        
相关标签:
3条回答
  • 2021-01-16 01:03

    This post should answer your questions. http://www.vogella.de/articles/MySQLJava/article.html You can obtain the needed mysql jar files from http://www.mysql.com/products/connector/

    0 讨论(0)
  • 2021-01-16 01:12

    You need to add the JDBC Connector J driver for Mysql database at mysql-Downloads to your classpath. You can follow the instruction on adding the external jars to Eclipse here by going to project properties->Java Build Path -> Libraries->Add External JARs

    0 讨论(0)
  • 2021-01-16 01:14

    As Dave points it out, the first thing is to check if a jar containing the com.mysql.jdbc.Driver class is amongst your other libraries.

    If not, add it.

    0 讨论(0)
提交回复
热议问题