Package com.ibatis.dao.client

Examples of com.ibatis.dao.client.DaoException


        connection.commit();
      } finally {
        connection.close();
      }
    } catch (SQLException e) {
      throw new DaoException("Error committing JDBC transaction.  Cause: " + e);
    }
  }
View Full Code Here


        connection.rollback();
      } finally {
        connection.close();
      }
    } catch (SQLException e) {
      throw new DaoException("Error ending JDBC transaction.  Cause: " + e);
    }
  }
View Full Code Here

      } else if ("DBCP".equals(type)) {
        configureDbcp(properties);
      } else if ("JNDI".equals(type)) {
        configureJndi(properties);
      } else {
        throw new DaoException("DAO Transaction Manager properties must include a value for 'DataSource' of SIMPLE, DBCP or JNDI.");
      }
    } else {
      throw new DaoException("DAO Transaction Manager properties must include a value for 'DataSource' of SIMPLE, DBCP or JNDI.");
    }
  }
View Full Code Here

      } else {
        initCtx = new InitialContext(contextProps);
      }
      dataSource = (DataSource) initCtx.lookup((String) properties.get("DBJndiContext"));
    } catch (NamingException e) {
      throw new DaoException("There was an error configuring the DataSource from JNDI.  Cause: " + e, e);
    }
  }
View Full Code Here

   * @return A JDBC Connection instance.
   */
  protected Connection getConnection() {
    DaoTransaction trans = daoManager.getTransaction(this);
    if (!(trans instanceof ConnectionDaoTransaction)) {
      throw new DaoException("The DAO manager of type " + daoManager.getClass().getName() +
          " cannot supply a JDBC Connection for this template, and is therefore not" +
          "supported by JdbcDaoTemplate.");
    }
    return ((ConnectionDaoTransaction) trans).getConnection();
  }
View Full Code Here

   */
  public Object insert(String id, Object parameterObject) {
    try {
      return getSqlMapExecutor().insert(id, parameterObject);
    } catch (SQLException e) {
      throw new DaoException("Failed to insert - id ["
          + id + "], parameterObject [" + parameterObject + "]. Cause: " + e, e);
    }
  }
View Full Code Here

   */
  public Object insert(String id) {
    try {
      return getSqlMapExecutor().insert(id);
    } catch (SQLException e) {
      throw new DaoException("Failed to insert - id ["
          + id + "]. Cause: " + e, e);
    }
  }
View Full Code Here

   */
  public int update(String id, Object parameterObject) {
    try {
      return getSqlMapExecutor().update(id, parameterObject);
    } catch (SQLException e) {
      throw new DaoException("Failed to update - id ["
          + id + "] - parameterObject [" + parameterObject + "].  Cause: " + e, e);
    }
  }
View Full Code Here

   */
  public int update(String id) {
    try {
      return getSqlMapExecutor().update(id);
    } catch (SQLException e) {
      throw new DaoException("Failed to update - id ["
          + id + "].  Cause: " + e, e);
    }
  }
View Full Code Here

   */
  public int delete(String id, Object parameterObject) {
    try {
      return getSqlMapExecutor().delete(id, parameterObject);
    } catch (SQLException e) {
      throw new DaoException("Failed to delete - id ["
          + id + "] - parameterObject [" + parameterObject + "].  Cause: " + e, e);
    }
  }
View Full Code Here

TOP

Related Classes of com.ibatis.dao.client.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.