I found out how to do this, by the way, but the connection() method is deprecated, so it is not the ideal solution. Here it is with the procedure version of the method:
Code:
try
{
Session session = getSession();
String sql = "{CALL PACKAGE.PROCEDURE(?, ?)}";
CallableStatement statement = session.connection().prepareCall( sql );
statement.setLong(1, longParameter);
statement.registerOutParameter(2, Types.VARCHAR);
statement.execute();
return statement.getString(2);
}
catch ( SQLException ex )
{
// Whatever you want to do
}