报错信息
java.sql.BatchUpdateException: 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 'USE VALUES (NULL,'user9','psw9')' at line 1
//BatchUpdateException 批处理执行异常
//sql语句错误 syntax
//原因 数据库名没有正确书写
报错代码
PreparedStatement pst = con.prepareStatement("INSERT INTO USE VALUES (NULL,?,?)");
错误分析
// 数据库里面 没有USE 只有USER 数据库名没有正确书写
解决方案
//严格按照sql语法 书写 检查是否有错误值
PreparedStatement pst = con.prepareStatement("INSERT INTO USER VALUES (NULL,?,?)");