PreparedStatement不能动态设置表名

    技术2022-08-01  107

    pt = conn.prepareStatement("select * from table=? where sno=? and password=?");         pt.setString(1, status);         pt.setString(2, account);         pt.setString(3, password);

    报错: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 'table='stu' where sno='2141123' and password='123'' at line 1

    原因:https://blog.csdn.net/qq_39015329/article/details/77525038

    Processed: 0.022, SQL: 9