java.sql.SQLException: Could not retrieve transation read-only status server Query: insert into t_user values (?,?,?,?,?,?,?,?) Parameters: [null, ss, 123, ss, 111, 1, 11, 1111]
at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:320)
at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:489)
at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:402)
at cn.itcast.jdbc.TxQueryRunner.update(TxQueryRunner.java:55)
at com.hongyi.dao.UserDAO.addUser(UserDAO.java:26)
at com.hongyi.servlet.UserServlet.addUser(UserServlet.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at

这个是mysql 驱动的版本不同造成的!!!


根据你的MySQL选择合适的驱动jar就好弄了
我的数据库是6.0.11

之前用的jar是mysql-connector-java-5.1.28-bin.jar

换成​​mysql-connector-java-5.1.7-bin.jar就好了