Need some help with a JDBC query. I would have tried it out myself, but right now I do not have access to a database.
My question is: Since CallableStatement extends PreparedStatement, does this mean we can use CallableStatement to execute any query prepared for prepared statement?
More specifically, any downsides to using Callable like this:
CallableStatement stmt = null;
String sql = "UPDATE Employees set age=30 WHERE id=";
stmt = conn.prepareCall(sql);
int empID = 102;
stmt.setInt(1, empID); );
stmt.execute();
stmt.close();
conn.close();