protected long buildNextSequence ( PersistenceBroker broker , ClassDescriptor cld , String sequenceName ) throws LookupException , SQLException , PlatformException { CallableStatement cs = null ; try { Connection con = broker . serviceConnectionManager ( ) . getConnection ( ) ; cs = getPlatform ( ) . prepareNextValProcedureStatement ( con , PROCEDURE_NAME , sequenceName ) ; cs . executeUpdate ( ) ; return cs . getLong ( 1 ) ; } finally { try { if ( cs != null ) cs . close ( ) ; } catch ( SQLException ignore ) { // ignore it } } }
Calls the stored procedure stored procedure throws an error if it doesn t exist .