Hello Mr.Sanjeev Kaushik,
Here is the part of my code where I like to insert records in the loop.
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
Vector getvector=new Vector();
int transMaxId=0;
String query="insert into Sample(id,name,no) values(?,?,?)";
PreparedStatement pstatement=igeteniv.getPreparedStatement(query);
int vecsize=getvector.size();
Vector internal=new Vector();
internal=getvector;
for(int i=0;i<vecsize;i++)
{
transMaxId=transMaxId+1;
try {
pstatement.setInt(1,transMaxId);
pstatement.setString(2,internal.get(i).toString());
pstatement.setString(3,"1");
pstatement.addBatch();
int[] ss=pstatement.executeBatch();
} catch (SQLException e) {
e.printStackTrace();
}
}
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
Still the code works fine without connection reset error,if the query is SELECT.Hope U wuld reply.
Thanks & Regards,
Sonara.