String sql = "select id,user_name from t_user t where t.user_name= ? and t.password= ? ";
conn = connectionManager.getConnection();
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1,"xiao");
pstmt.setString(2,"123456");
rs = pstmt.executeQuery(sql);
运行后提示下面的错
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 '? and t.password= ?' at line 1Mysql是5.0的
Mysql jar是mysql-connector-java-5.1.13-bin
请教高手啊