Package com.knowgate.storage

Examples of com.knowgate.storage.StorageException


  public boolean useJDBC() {
    return bJdb;
  }
   
  public Table getTable() throws StorageException {
    if (null==oCon) throw new StorageException("Not connected to the database through JDBC");
    return oCon;
  }
View Full Code Here


  public void setDocument(Document oAtrilDocument) {
    oDoc = oAtrilDocument;
  }
 
  public void connect() throws StorageException {
    if (oCon!=null || oSes!=null) throw new StorageException("Already connected");
    sTbl = getClass().getName();
    if (useJDBC()) {
      try {
        oCon = DAO.getConnection(sTbl);
        oCon.setAutoCommit(false);
      } catch (SQLException sqle) {
        throw new StorageException(sqle.getMessage(), sqle);
      }
    }
    if (useAtril()) {
      oSes = SessionCache.getAdminSession(sTbl);
      if (null==oSes) {
View Full Code Here

    bIsCachedSession = false;
    bIsAdminSession = true;
  }

  public void connect(String sNickName, String sPassword) throws StorageException {
    if (oCon!=null || oSes!=null) throw new StorageException("Already connected");
    sTbl = getClass().getName();
    if (useJDBC()) {
      try {
        oCon = DAO.getConnection(sTbl);
        oCon.setAutoCommit(false);
      } catch (SQLException sqle) {
        throw new StorageException(sqle.getMessage(), sqle);
      }
    }
    if (useAtril()) {
      oSes = SessionCache.getSession(getContext().getRequest().getSession().getId());
      if (null!=oSes) {
View Full Code Here

      bIsAdminSession = false;
    }
  }
 
  public void connect(String sTableName) throws StorageException {
    if (oCon!=null) throw new StorageException("Already connected");
    sTbl = sTableName==null ? getClass().getName() : sTableName;
    try {
      oCon = DAO.getConnection(sTbl);
      oCon.setAutoCommit(false);
    } catch (SQLException sqle) {
      throw new StorageException(sqle.getMessage(), sqle);
    }
    if (useAtril()) {
      oSes = SessionCache.getAdminSession(sTbl);
      if (null==oSes) {
        oSes = DAO.getAdminSession(sTbl);       
View Full Code Here

          oCon.commit();
          oCon.close(sTbl);
          oCon = null;
        }
      } catch (SQLException sqle) {
        throw new StorageException(sqle.getMessage(), sqle);
      }
    }
    if (oSes!=null) {
        if (oSes.isConnected()) {
          if (!oSes.autoCommit()) oSes.commit();
View Full Code Here

      try {
        if (!oCon.isClosed()) {
          oCon.commit();
        }
      } catch (SQLException sqle) {
        throw new StorageException(sqle.getMessage(), sqle);
      }
    }
    if (oSes!=null) {
        if (oSes.isConnected()) {
          if (!oSes.autoCommit()) oSes.commit();
View Full Code Here

      try {
        if (!oCon.isClosed()) {
          oCon.rollback();
        }
      } catch (SQLException sqle) {
        throw new StorageException(sqle.getMessage(), sqle);
      }
    }
    if (oSes!=null) {
        if (oSes.isConnected()) {
          if (!oSes.autoCommit()) oSes.rollback();
View Full Code Here

TOP

Related Classes of com.knowgate.storage.StorageException

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.