do
{
String mid=res.getString(1);
String model=res.getString(2);
String name=res.getString(3);
int price=res.getInt(4);
String pcolor=res.getString(5);
String imei=res.getString(6);
java.sql.Date date=res.getDate(7);
String access=res.getString(8);
if(id.equals(mid) || id.equals(imei))
{
System.out.println("iam inside");
PreparedStatement prp=con2.prepareStatement("insert into msearch values(?,?,?,?,?,?,?,?)");
prp.setString(1,mid);
prp.setString(2,model);
prp.setString(3,name);
prp.setInt(4,price);
prp.setString(5,pcolor);
prp.setString(6,imei);
prp.setDate(7,date);
prp.setString(8,access);
prp.executeUpdate();
System.out.println("iam inside2");
rows++;
b=1;
jTextField1.setText("");
}
}while(res.next());
私はmysqlを初めて使用します
上記のコードを実行しようとしていますが、
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: SQL 構文にエラーがあります。1 行目の near '' を使用する正しい構文については、MySQL サーバーのバージョンに対応するマニュアルを確認してください。
何が問題なのですか、助けてください、