I got this message " java.sql.SQLException: Parameter index out of range (0 < 1 ) " when i try to pass data from a servlet to mysql database using a stored procedure and callable statement. i have to pass 13 parameters stored in array.
Please help me
Here is the code
Connection con=null;
CallableStatement proc = null;
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql:///projectclaire", "root", "");
proc = con.prepareCall("{ call do_upcli(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }");
for (int k=0;k <elts.length;k++)
{
proc.setString(k, elts[k]);
}
proc.setInt(13, b2);
proc.setInt(14, b3);
proc.execute();
response.sendRedirect("http://localhost:8080/uct/success3.jsp");;
proc.close();
}
catch(Exception e)
{
System.err.println("Exception: " + e.getMessage());
out.println(e);
out.println(e.getMessage());
}