hey i have used addBatch metho..but its coming error of null exception
pstmt = conn.prepareStatement("INSERT INTO gl_mast VALUES (?, ?, ?, ?, ?, ?)");
for (int n = 0; n < 100; n++) {
pstmt.setInt(1,Integer.parseInt(request.getParameter("gl_code1[n]")));
pstmt.setString(2,request.getParameter("gl_descr1[n]"));
pstmt.setFloat(3,Float.parseFloat(request.getParameter("db_amt1[n]")));
pstmt.setFloat(4,Float.parseFloat(request.getParameter("cr_amt1[n]")));
pstmt.setString(5,request.getParameter("gl_type1[n]"));
pstmt.setFloat(6,Float.parseFloat(request.getParameter("gl_pct1[n]")));

pstmt.addBatch();
}
pstmt.executeBatch();

error

HTTP Status 500 -

------------------------------------------------------------------------------- -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: null
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372 )
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.NumberFormatException: null
java.lang.Integer.parseInt(Integer.java:436)
java.lang.Integer.parseInt(Integer.java:518)
org.apache.jsp.MENU.gl_005fmaster.gl_005fsave_jsp._jspService(gl_005fsave_jsp. j ava:82)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324 )
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs.


------------------------------------------------------------------------------- -

Apache Tomcat/5.0.30


it retrieves values from below text

<input type="text" name="code" size="5" maxlength="5">
<input type="text" name="Description" size="55">
<input type="text" name="DrAmount" size="12" >
<input type="text" name="CrAmount" size="12"">
<input type="text" name="type" size="12"">

and this rows is increased for entering data..and its values like that..
Each time when adding a new row, the names are "incremented" following the pattern

1st row

name="code"
name="Description"
name="DrAmount"
name="DrAmount"
name="CrAmount"
name="type"

2nd row - new created

name="code_1"
name="Description_1"
name="DrAmount_1"
name="DrAmount_1"
name="CrAmount_1"
name="type_1"

3rd row - new created

name="code_1"
name="Description_1"
name="DrAmount_1"
name="DrAmount_1"
name="CrAmount_1"
name="type_1"