To execute a stored procedure "totalStock" in a database server, which of the following code snippet is used?
Options
- Statement stmt = connection.createStatement(); stmt.execute("totalStock()");
- CallableStatement clbstmnt = con.prepareCall("{call totalStock}"); cs.executeQuery();
- StoreProcedureStatement spstmt = connection.createStoreProcedure("totalStock()"); spstmt.executeQuery();
- PrepareStatement pstmt = connection.prepareStatement("totalStock()"); pstmt.execute();
CORRECT ANSWER : CallableStatement clbstmnt = con.prepareCall("{call totalStock}"); cs.executeQuery();
Write your comments