Examples of DatabaseConnection


Examples of com.j256.ormlite.support.DatabaseConnection

      if (data instanceof BaseDaoEnabled) {
        @SuppressWarnings("unchecked")
        BaseDaoEnabled<T, ID> daoEnabled = (BaseDaoEnabled<T, ID>) data;
        daoEnabled.setDao(this);
      }
      DatabaseConnection connection = connectionSource.getReadOnlyConnection();
      try {
        return statementExecutor.refresh(connection, data);
      } finally {
        connectionSource.releaseConnection(connection);
      }
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection

    checkForInitialized();
    // ignore deleting a null object
    if (data == null) {
      return 0;
    } else {
      DatabaseConnection connection = connectionSource.getReadWriteConnection();
      try {
        return statementExecutor.delete(connection, data);
      } finally {
        connectionSource.releaseConnection(connection);
      }
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection

    checkForInitialized();
    // ignore deleting a null object
    if (datas == null || datas.isEmpty()) {
      return 0;
    } else {
      DatabaseConnection connection = connectionSource.getReadWriteConnection();
      try {
        return statementExecutor.deleteObjects(connection, datas);
      } finally {
        connectionSource.releaseConnection(connection);
      }
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection

    checkForInitialized();
    // ignore deleting a null object
    if (ids == null || ids.isEmpty()) {
      return 0;
    } else {
      DatabaseConnection connection = connectionSource.getReadWriteConnection();
      try {
        return statementExecutor.deleteIds(connection, ids);
      } finally {
        connectionSource.releaseConnection(connection);
      }
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection

    }
  }

  public int delete(PreparedDelete<T> preparedDelete) throws SQLException {
    checkForInitialized();
    DatabaseConnection connection = connectionSource.getReadWriteConnection();
    try {
      return statementExecutor.delete(connection, preparedDelete);
    } finally {
      connectionSource.releaseConnection(connection);
    }
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection

    }
  }

  public int executeRaw(String statement, String... arguments) throws SQLException {
    checkForInitialized();
    DatabaseConnection connection = connectionSource.getReadWriteConnection();
    try {
      return statementExecutor.executeRaw(connection, statement, arguments);
    } catch (SQLException e) {
      throw SqlExceptionUtil.create("Could not run raw execute statement " + statement, e);
    } finally {
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection

    }
  }

  public int updateRaw(String statement, String... arguments) throws SQLException {
    checkForInitialized();
    DatabaseConnection connection = connectionSource.getReadWriteConnection();
    try {
      return statementExecutor.updateRaw(connection, statement, arguments);
    } catch (SQLException e) {
      throw SqlExceptionUtil.create("Could not run raw update statement " + statement, e);
    } finally {
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection

    }
  }

  public <CT> CT callBatchTasks(Callable<CT> callable) throws Exception {
    checkForInitialized();
    DatabaseConnection connection = connectionSource.getReadWriteConnection();
    try {
      /*
       * We need to save the connection because we are going to be disabling auto-commit on it and we don't want
       * pooled connection factories to give us another connection where auto-commit might still be enabled.
       */
 
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection

    return tableInfo.isUpdatable();
  }

  public boolean isTableExists() throws SQLException {
    checkForInitialized();
    DatabaseConnection connection = connectionSource.getReadOnlyConnection();
    try {
      return connection.isTableExists(tableInfo.getTableName());
    } finally {
      connectionSource.releaseConnection(connection);
    }
  }
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection

    }
  }

  public long countOf() throws SQLException {
    checkForInitialized();
    DatabaseConnection connection = connectionSource.getReadOnlyConnection();
    try {
      return statementExecutor.queryForCountStar(connection);
    } finally {
      connectionSource.releaseConnection(connection);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.