hello,
i am using preparestatement to insert muliple rows into database.
String query = "insert into table_temp(col1,col2) values(?,?)";
pstmt = con.prepareStatement(query);
pstmt.setString(1,"a");
pstmt.setInt(2,100);
pstmt.addBatch();
pstmt.setString(1,"b");
pstmt.setInt(2,null);
pstmt.addBatch();
int[] cnt = pstmt.executeBatch();
My problem is that in the 2nd addBatch block i dont want to insert any value into the col2, which is a numeric field.
And i dont want to do it in a different query.
How to do that.
Please help