KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > samples > jpetstore > dao > ibatis > OracleSequenceDao


1 package org.springframework.samples.jpetstore.dao.ibatis;
2
3 import org.springframework.dao.DataAccessException;
4
5 public class OracleSequenceDao extends SqlMapSequenceDao {
6
7   /**
8    * Get the next sequence using an Oracle thread-safe sequence
9    * @param name Name is the name of the oracle sequence.
10    * @return the next sequence
11    */

12   public int getNextId(String JavaDoc name) throws DataAccessException {
13     Sequence sequence = new Sequence();
14     sequence.setName(name);
15     sequence = (Sequence) getSqlMapClientTemplate().queryForObject("oracleSequence", sequence);
16     return sequence.getNextId();
17   }
18
19 }
20
Popular Tags