org.glite.security.voms.database
Interface Sequence


public interface Sequence

Database-independent sequence API.


Method Summary
 long nextval()
          Increments the sequence and returns the new value.
 Sequence update(java.lang.String table, java.lang.String column)
          Update sequence value based on the maximum value in a column of a database table.
 

Method Detail

nextval

public long nextval()
             throws GeneralDatabaseException
Increments the sequence and returns the new value.

Throws:
GeneralDatabaseException

update

public Sequence update(java.lang.String table,
                       java.lang.String column)
Update sequence value based on the maximum value in a column of a database table.

Example:

   static final Sequence seq = new Sequence ("acl").update ("acl", "aid").update ("acld", "aid");
 

Parameters:
table - the name of the table to query
column - the name of the column in the given table to query
Returns:
the Sequence object itself (for chained method calls)
Throws:
java.lang.IllegalArgumentException - if a parameter contains an invalid SQL identifier
java.lang.RuntimeException - (unchecked!) if a database error or inconsistency occurs.