Package hirondelle.web4j.database

Examples of hirondelle.web4j.database.DAOException


      Code code = null;
      try {
        code = new Code(id, SafeText.from(id.toString()));
      }
      catch (ModelCtorException ex){
        throw new DAOException("Cannot build Code in expected manner.",ex);     
      }
      result.put(id, code);
    }
    return result;
  }
View Full Code Here


      addDatabaseURIs(result, metaData);
      addNamesAndVersions(result, metaData);
      addDriverNamesAndVersions(result, metaData);
    }
    catch (SQLException ex){
      throw new DAOException("Cannot access database metadata.", ex);
    }
    finally {
      close(connection);
    }
    return result;
View Full Code Here

        fLogger.fine("Closing connection.");
        aConnection.close();
      }
    }
    catch (SQLException ex){
      throw new DAOException("Cannot close connection.", ex);
    }
  }
View Full Code Here

   {@link #setBehavior(DbOperation, DbOperationResult)}.
  */
  public static void possiblyThrowExceptionFor(DbOperation aOperation) throws DAOException, DuplicateException {
    DbOperationResult opResult = getOperationResult(aOperation);
    if (FakeDAOBehavior.DbOperationResult.Succeed == opResult) return;
    if (FakeDAOBehavior.DbOperationResult.ThrowDAOException == opResult) throw new DAOException(FORCED_FAILURE, FORCED_EXCEPTION);
    if (FakeDAOBehavior.DbOperationResult.ThrowDuplicateException == opResult) throw new DuplicateException(FORCED_FAILURE, FORCED_EXCEPTION);
  }
View Full Code Here

        fLogger.severe("Datasource is null for : " + dbConnString);
      }
      result = datasource.getConnection();
    }
    catch (NamingException ex){
      throw new DAOException(
        "Config error with JNDI and datasource, for db " + Util.quote(dbConnString), ex
      );
    }
    catch (SQLException ex ){
      throw new DAOException(
        "Cannot get JNDI connection from datasource, for db " + Util.quote(dbConnString),
        ex
      );
    }
    return result;
View Full Code Here

        fLogger.severe("Datasource is null for : " + dbConnString);
      }
      result = datasource.getConnection();
    }
    catch (NamingException ex){
      throw new DAOException(
        "Config error with JNDI and datasource, for db " + Util.quote(dbConnString), ex
      );
    }
    catch (SQLException ex ){
      throw new DAOException(
        "Cannot get JNDI connection from datasource, for db " + Util.quote(dbConnString),
        ex
      );
    }
    return result;
View Full Code Here

TOP

Related Classes of hirondelle.web4j.database.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.