Package org.xooof.xooofoscope.dao.exception

Examples of org.xooof.xooofoscope.dao.exception.DAOException


  }
 
  protected static Integer getSequenceNextVal(String sequenceName) throws DAOException {
   
    if (sequenceName == null) {
      throw new DAOException("sequenceName cannot be null");
    }
    Integer nextval=null;
    PreparedStatement statement = null;
    ResultSet result;  
    Connection connection = DAOHelper.getDBConnection();   
    try {  
      try
      {
      statement = connection.prepareStatement(NEXTVAL_QRY);
      statement.setString(1, sequenceName);
      result = statement.executeQuery();
      if(result.next())
      {
        nextval = new Integer(result.getInt("nextval"));
        if(result.next())
        {
        throw new DAOException("Multiple rows returned for nextval sequence '"+sequenceName+"'");
        }
      }
      else {    
        throw new DAOException("Selection of nextval for sequence '" + sequenceName + "' returned no row");
      }
      }
      catch(SQLException exc)
      {
        throw new DAOException(exc.getMessage());
      }//End catch IOException
    }
    // This code is to be executed each time in order to release DB Connections
    finally
    {
View Full Code Here

TOP

Related Classes of org.xooof.xooofoscope.dao.exception.DAOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.