JDBC — java.lang.NoClassDefFoundError: Could not initialize class com.mysql.jdbc.Connection

后端 未结 2 1586
独厮守ぢ
独厮守ぢ 2021-01-17 01:37

I have the following code that\'s trying to establish a connection to a remote database. It\'s throwing an exception, and I can\'t figure out why.

    impor         


        
2条回答
  •  [愿得一人]
    2021-01-17 01:59

    This is almost certainly because you are missing the jdbc driver jar for MySql. You can find it Here. Unzip it and add the jar to your classpath.

    Update: You can not use MySQL with GAE because sockets are not allowed. This will never work for you. They have alternative persistence mechanisms besides MySQL. See: Can I use a MySQL database with an App Engine application

提交回复
热议问题