Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java mysql连接错误_Java_Netbeans 7_Mysql Error 1064_Mysql Connect - Fatal编程技术网

Java mysql连接错误

Java mysql连接错误,java,netbeans-7,mysql-error-1064,mysql-connect,Java,Netbeans 7,Mysql Error 1064,Mysql Connect,我尝试用java连接mysql,但出现了编译器错误 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 我添加了mysql libraray,但这是有缺陷的:Cla

我尝试用java连接mysql,但出现了编译器错误

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
我添加了mysql libraray,但这是有缺陷的:
Class.forName(“com.mysql.jdbc.Driver”)


我该怎么办?

MySQLSyntaxErrorException
表示您已经连接到MySQL,但您试图执行的SQL脚本存在一些问题。

您应该在问题中包含SQL代码。您的SQL查询可能是错误的。您确定,在我看来是例外而不是编译错误吗