CallableStatement callableStatement = connection.prepareCall("{call get_count(?)}"); callableStatement.registerOutParameter(1, Types.BIGINT); callableStatement.execute(); long count = callableStatement.getLong(1);
CallableStatement callableStatement = connection.prepareCall("{? = call increment(?)})"); callableStatement.setLong(2, 10); callableStatement.registerOutParameter(1, Types.BIGINT); callableStatement.execute(); long incrementedValue = callableStatement.getLong(1);The getLong() method is part of the java.sql package and can be found in the java.sql.CallableStatement interface.