In mysql-connecter-java-5.0 Statement is a class. in 5.1, it’s an interface.
The code you write shouldn’t care too much. But if you compile against the new version, then run against the old version, you’ll have this problem.
我项目中用的是5.1的版本,而在5.1中Connection 和Statement 为接口,而在5.0版本中为class。将jar包替换为mysql-connecter-java-5.0即可