Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MySQL server 4.1.12 & JSP's
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Naughtyus
Guru
Guru


Joined: 14 Jul 2002
Posts: 463
Location: Vancouver, BC

PostPosted: Fri Nov 04, 2005 11:01 pm    Post subject: MySQL server 4.1.12 & JSP's Reply with quote

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!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum