1.
java.sql.SQLException: Column count doesn't match value count at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
at com.zhao.dbquery.Test.main(Test.java:37)
原因:是用了中文的,号而不是英文的,~~~~~O,shit
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 'nsert into tab_guestbook (UserName,title,Content,AddTime,Email) values ('1' at line 1
以上是中文的,占一格的位置
String sql = "insert into tab_guestbook (UserName,Title,Content,AddTime,Email) values (?,?,?,?,?)";
这才是英文
2.
servlet的调用地址是如login 而不是login.do ,*.do是struts的过滤地址,调用地址~~
3.
老问题:
myeclipse编辑器的编码问题
在myeclipse-->myeclipse-->perferences里可以设定js,java,xml等编辑时用的编码。
解决有时候把一些文本复制过来时出现乱码的问题~~
java.sql.SQLException: Column count doesn't match value count at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
at com.zhao.dbquery.Test.main(Test.java:37)
原因:是用了中文的,号而不是英文的,~~~~~O,shit
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 'nsert into tab_guestbook (UserName,title,Content,AddTime,Email) values ('1' at line 1
以上是中文的,占一格的位置
String sql = "insert into tab_guestbook (UserName,Title,Content,AddTime,Email) values (?,?,?,?,?)";
这才是英文
2.
servlet的调用地址是如login 而不是login.do ,*.do是struts的过滤地址,调用地址~~
3.
老问题:
myeclipse编辑器的编码问题
在myeclipse-->myeclipse-->perferences里可以设定js,java,xml等编辑时用的编码。
解决有时候把一些文本复制过来时出现乱码的问题~~