Com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:You has an error in your SQL syntax; Check the manual that corresponds to your MySQL
Server version for the right syntax-use near ' receivertel= ' 123131 ' payment=0,time = ' 2015-04-10 10:14 ', tradetime= ', snd Goodsti ' at line 1at com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:936) 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)
This is because Receivertel and payment are missing a comma,
String sql = "Update em_order set orderid=?,userid=?,receivername=?,receiveraddress=?,postcode=?" Receivertel=?,payment=?,time =?, Tradetime=?,
Sndgoodstime=? State=? WHERE id =? "; Jdbcutils.update (Sql,o.getorderid (), O.getuserid (), O.getreceivername (), o.getreceiveraddress (), O.getPostCode (), O.getreceivertel (),
O.getpayment (), O.gettime (), O.gettradetime (), O.getsndgoodstime (), O.getstate (), O.getid ());
Java.sql.SQLException:Parameter index out of range (one > number of Paramete,which is 0);
This error is due to one less write? In the query database code.
Com.mysql.jdbc.exceptions.MySQLSyntaxErrorException Error