Package ch.epfl.lbd.database.connection.exception

Examples of ch.epfl.lbd.database.connection.exception.DatabaseConnectionException


        this.databaseName =      props.getProperty(connectionName+".jdbc.database");
      }
   
      //otherwise if it is an xml it will be formatted using Hibernate conf. format
      else{
        throw new DatabaseConnectionException("wrong parameter configuration file");
      }
    }
    catch(DatabaseConnectionException e){
      e.printStackTrace();
    }
View Full Code Here


   *
   * @throws DatabaseConnectionException if the connection was already opened
   * @return true if the connection is established correctly
   * **/
  public boolean openConnection() throws DatabaseConnectionException{
    if(opened) throw new DatabaseConnectionException("The Connection was already opened");
    else opened = true;
   
    if(hibernateSession == null && hibernateEnabled){
      SessionFactory session = hibernateUtility.getSessionFactory();
      hibernateSession = session.getCurrentSession();
View Full Code Here

   *
   * @throws DatabaseConnectionException if the connection was already closed
   * @return true if the connection is closed correctly
   * **/
  public boolean closeConnection() throws DatabaseConnectionException{
    if(!opened) throw new DatabaseConnectionException("The Connection was already closed");
    else opened = false;
    if(hibernateEnabled)hibernateSession.close();
    return true;
  }
View Full Code Here

TOP

Related Classes of ch.epfl.lbd.database.connection.exception.DatabaseConnectionException

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.