Thursday, January 19, 2012

ADF 11g : How to get the Sequence Number

Get the Sequence Number
------------------------
Put this method in to AMImpl.java and expose it as client Interface inside DataControl

public oracle.jbo.domain.Number getSequenceNumber() {

try{
String seq = "your_db_sequence_name";
oracle.jbo.server.SequenceImpl theSeq = new oracle.jbo.server.SequenceImpl(seq, getDBTransaction());
oracle.jbo.domain.Number seqNextNumber = theSeq.getSequenceNumber();return seqNextNumber;

}catch (Exception e){
//handle exceptions}

return null;
}