小白--Java JDBC 连接mysql数据库
在连接mysql数据库时遇到这样的情况
主人信息列表
编号 姓名 元宝
[Master [id=0, loginid=0, pwd=666666, money=100, status=有效],
Master [id=1, loginid=0, pwd=123456, money=100, status=有效],
Master [id=2, loginid=0, pwd=123456, money=10000, status=有效]]
java.sql.SQLException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '',pwd='123456',money='100',m_status='鏈夋晥 where id=2' at line 1"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278)
at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1224)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2244)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2192)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1259)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1205)
at chapter1101.MasterManager.updateMaster(MasterManager.java:150)
at chapter1101.TestA.main(TestA.java:21)