求助mysql Update语句总是报错
package text;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class text {
public static void main(String[] args){
text a=new text();
try {
a.text();
} catch (ClassNotFoundException | SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void text() throws ClassNotFoundException, SQLException{
Class.forName("com.mysql.jdbc.Driver");
String url="jdbc:mysql://localhost:3306/user1?user=root&password=";
Connection conn=DriverManager.getConnection(url);
String sql2="Update parking set Condition='ee' where Condition='qq' ";
Statement stmt=(Statement) conn.createStatement();
stmt.executeUpdate(sql2);
}
}
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 'Condition='ee' where Condition='qq'' at line 1