Can't connect to MySQL from Java: NullPointerException inside MySQL driver connection logic

前端 未结 3 1527
感情败类
感情败类 2020-11-30 12:54

I\'m trying to connect to a database I created with MySQL in my Java program, but it always fails.

For the sake of example, here is my code:

import j         


        
3条回答
  •  伪装坚强ぢ
    2020-11-30 13:11

    Sounds like a potential version mismatch or outdated client. When you run it outside the IDE you may be pulling in the wrong version. I'd make sure the client is on the latest version or similar to the version used by the server.

提交回复
热议问题