Package com.scooterframework.orm.sqldataexpress.exception

Examples of com.scooterframework.orm.sqldataexpress.exception.CreateConnectionFailureException


      if (loginTimeout != null)
        ds.setLoginTimeout(loginTimeout.intValue());

      connection = ds.getConnection();
    } catch (SQLException ex) {
      throw new CreateConnectionFailureException(
          "ConnectionUtil.createPooledConnection failed for conectionName \"" + connectionName
              + "\" because " + ex.getMessage(), ex);
    }

    return connection;
View Full Code Here


      if (loginTimeout != null)
        ds.setLoginTimeout(loginTimeout.intValue());

      connection = ds.getConnection(username, password);
    } catch (SQLException ex) {
      throw new CreateConnectionFailureException(
          "ConnectionUtil.createPooledConnection failed for conectionName \"" + connectionName
              + "\" because " + ex.getMessage(), ex);
    }

    return connection;
View Full Code Here

      DatabaseConnectionContext dcc) {
    try {
      if (dcc.isReadonly())
        connection.setReadOnly(true);
    } catch (SQLException ex) {
      throw new CreateConnectionFailureException(
          "Faied to set readonly property for connection \""
              + dcc.getConnectionName() + "\" because " + ex.getMessage(), ex);
    }
  }
View Full Code Here

      DatabaseConnectionContext dcc) {
    try {
      if (!dcc.isAutoCommit())
        connection.setAutoCommit(false);
    } catch (SQLException ex) {
      throw new CreateConnectionFailureException(
          "Faied to set readonly property for connection \""
              + dcc.getConnectionName() + "\" because " + ex.getMessage(), ex);
    }
  }
View Full Code Here

      DatabaseConnectionContext dcc) {
    try {
      if (dcc.hasSpecifiedTransactionIsolationLevel())
        connection.setTransactionIsolation(dcc.getTransactionIsolationLevel());
    } catch (SQLException ex) {
      throw new CreateConnectionFailureException(
          "Faied to set transaction isolation property for connection \""
              + dcc.getConnectionName() + "\" because " + ex.getMessage(), ex);
    }
  }
View Full Code Here

      autoCommit = conn.getAutoCommit();
    }
    catch(Exception ex) {
      String errorMessage = "Failed to get auto commit for the underlying connection.";
      log.error(errorMessage, ex);
      throw new CreateConnectionFailureException(errorMessage, ex);
    }
     
      return autoCommit;
    }
View Full Code Here

      }
    }
    catch(Exception ex) {
      String errorMessage = "Failed to set auto commit for the underlying connection.";
      log.error(errorMessage, ex);
      throw new CreateConnectionFailureException(errorMessage, ex);
    }
    }
View Full Code Here

     * @param connName  database connection name
     * @return UserDatabaseConnection
     */
    public UserDatabaseConnection createUserDatabaseConnection(String connName) {
        if (connName == null || connName.equals(""))
            throw new CreateConnectionFailureException("Failed to create a database connection: connection name is null.");
       
        Properties prop = DatabaseConfig.getInstance().getPredefinedDatabaseConnectionProperties(connName);
       
        return buildUserDatabaseConnection(connName, prop);
    }
View Full Code Here

        }
        else if (dcc instanceof JdbcConnectionContext) {
            udc = new JdbcConnection((JdbcConnectionContext)udc);
        }
        else {
            throw new CreateConnectionFailureException("Failed to create a database connection: " +
                "input DatabaseConnectionContext instance is neither " +
                "a DataSourceConnectionContext nor a JdbcConnectionContext type of instance.");
        }
       
        return udc;
View Full Code Here

     * @return UserDatabaseConnection
     * @param prop Connection properties
     */
    private UserDatabaseConnection buildUserDatabaseConnection(String connectionName, Properties prop) {
        if (prop == null || prop.size() == 0)
            throw new CreateConnectionFailureException("Failed to create a database connection: connection properties is null.");
       
        UserDatabaseConnection udc = null;
       
        //now find if it is dataSouce type
        if (isDataSourceConnectionContext(prop)) {
View Full Code Here

TOP

Related Classes of com.scooterframework.orm.sqldataexpress.exception.CreateConnectionFailureException

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.