Naughtyus Guru
Joined: 14 Jul 2002 Posts: 463 Location: Vancouver, BC
|
Posted: Fri Nov 04, 2005 11:01 pm Post subject: MySQL server 4.1.12 & JSP's |
|
|
I recently upgraded the version of MySQL on my server from 4.0.x to 4.1.12, and am having problems running prepared statements. The following java code worked before, but now returns an error:
Code: | String sql = "INSERT INTO personalInfo("
+ "sinno,"
+ "lname,"
+ "fname,"
+ "mname,"
+ "email,"
+ "mstatus,"
+ "yrs,"
+ "mths,"
+ "days,"
+ "title)"
+ "VALUES(?,?,?,?,?,?,?,?,?,?)";
PreparedStatement pstmt = con.prepareStatement(sql);
pstmt.setString(1, sin);
pstmt.setString(2, lname);
pstmt.setString(3, fname);
pstmt.setString(4, mname);
pstmt.setString(5, email);
pstmt.setString(6, mstatus);
pstmt.setString(7, yrs);
pstmt.setString(8, mths);
pstmt.setString(9, days);
pstmt.setString(10, title);
pstmt.executeUpdate(); |
The error is:
"java.sql.SQLException: Incorrect arguments to mysql_stmt_execute"
Help! |
|