wood burning stoves 2.0*
The moose likes JDBC and the fly likes error in Insert Query using Perpared statments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "error in Insert Query using Perpared statments " Watch "error in Insert Query using Perpared statments " New topic
Author

error in Insert Query using Perpared statments

sahar sa
Ranch Hand

Joined: Jul 06, 2009
Posts: 102
Dear friends,
I am tring to write a query using PSTMT but it throws me this error:
SQLException: Parameter index out of range (4 > number of parameters, which is 3).
SQLState: S1009
VendorError: 0
SQLException: Parameter index out of range (4 > number of parameters, which is 3).
SQLState: S1009
VendorError: 0
SQLException: Parameter index out of range (4 > number of parameters, which is 3).
SQLState: S1009
VendorError: 0

, here is the insert code and the trigger code:
Insert Query:



and trigger code:


do you have any idea whats wrong?

Thanks!
Sahar.


Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
In your insert sql statement there exists 3 question marks(?), but you are trying to set the 4th ? as I see in your post line number 13.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error in Insert Query using Perpared statments