CallableStatement cstmt = conn.prepareCall("{call myStoredProc(?)}"); cstmt.setLong(1, 100L); cstmt.execute();
CallableStatement cstmt = conn.prepareCall("{call myStoredProc(?, ?)}"); cstmt.setLong(1, 100L); cstmt.setLong(2, 200L); cstmt.execute();In this example, we are setting the first and second parameters of the stored procedure "myStoredProc" to the values of 100 and 200, respectively. Package Library: The setLong method is part of the java.sql package. The java.sql package provides a standard interface for accessing and manipulating databases.