CallableStatement cstmt = conn.prepareCall("{ ? = call getEmployeeName(?) }"); cstmt.registerOutParameter(1, java.sql.Types.VARCHAR); cstmt.setInt(2, 1001); cstmt.execute(); String name = cstmt.getString(1); if(cstmt.wasNull()) { System.out.println("The name retrieved is null."); } else { System.out.println("The name retrieved is: " + name); }In this example, a stored procedure `getEmployeeName()` is called with an input parameter of employee id. The output parameter of type VARCHAR is registered using `registerOutParameter()` method. The `execute()` method is then called to execute the stored procedure. The retrieved value is then checked if it is null using the `wasNull()` method. The java.sql package library contains the CallableStatement interface.