About Question enthuware.ocpjp.v11.2.3368 :
Posted: Thu Jan 07, 2021 8:21 am
I am wondering, if the explanation is correct: "...indexing of database columns starts with 1..."
http://tutorials.jenkov.com/jdbc/prepar ... %20updates.
I read in the link above that you replace "?" of a PreparedStatement with the values from setXXX(). And there counting starts with 1.
So the other values should be incremented as well, right?
http://tutorials.jenkov.com/jdbc/prepar ... %20updates.
I read in the link above that you replace "?" of a PreparedStatement with the values from setXXX(). And there counting starts with 1.
So the other values should be incremented as well, right?
Code: Select all
ps.setObject(2, "Ally A", JDBCType.VARCHAR); //2
ps.setObject(3, "101 main str"); //3
ps.executeUpdate(); //4
ps.setObject(2, "Bob B"); //5