Package org.apache.derby.iapi.jdbc

Examples of org.apache.derby.iapi.jdbc.EngineConnection


        xaDataSource.setDatabaseName(getShortDbName());
        appendAttrString(p);
        if (attrString != null)
            xaDataSource.setConnectionAttributes(attrString);
       
        EngineConnection conn = getConnection();
        // If we have no existing connection. this is a brand new XAConnection.
        if (conn == null)
        {
            xaConnection = xaDataSource.getXAConnection(userId,password);
            ra = xaDataSource.getResourceAdapter();
            setXAResource(xaConnection.getXAResource());
        }
        else // this is just a connection reset. Close the logical connection.
        {
            conn.close();
        }
       
        // Get a new logical connection.
        // Contract between network server and embedded engine
        // is that any connection returned implements EngineConnection.
        conn = (EngineConnection) xaConnection.getConnection();
        // Client will always drive the commits so connection should
        // always be autocommit false on the server. DERBY-898/DERBY-899
        conn.setAutoCommit(false);
        setConnection(conn);       
    }
View Full Code Here


        xaDataSource.setDatabaseName(getShortDbName());
        appendAttrString(p);
        if (attrString != null)
            xaDataSource.setConnectionAttributes(attrString);
       
        EngineConnection conn = getConnection();
        // If we have no existing connection. this is a brand new XAConnection.
        if (conn == null)
        {
            xaConnection = xaDataSource.getXAConnection(userId,password);
            ra = xaDataSource.getResourceAdapter();
            setXAResource(xaConnection.getXAResource());
        }
        else // this is just a connection reset. Close the logical connection.
        {
            conn.close();
        }
       
        // Get a new logical connection.
        // Contract between network server and embedded engine
        // is that any connection returned implements EngineConnection.
        conn = (EngineConnection) xaConnection.getConnection();
        // Client will always drive the commits so connection should
        // always be autocommit false on the server. DERBY-898/DERBY-899
        conn.setAutoCommit(false);
        setConnection(conn);       
    }
View Full Code Here

    // do local work with conn
    // need to create new connection here.
  */
  public EngineConnection getRealConnection() throws SQLException
  {
        EngineConnection rc = super.getRealConnection();
    if (rc != null)
      return rc;

    openRealConnection();

View Full Code Here

    // do local work with conn
    // need to create new connection here.
  */
  public EngineConnection getRealConnection() throws SQLException
  {
        EngineConnection rc = super.getRealConnection();
    if (rc != null)
      return rc;

    openRealConnection();

View Full Code Here

   */
  private PreparedStatement prepareStatementJDBC3(String sqlStmt, int
                          scrollType, int concurType,
                          int withHoldCursor) throws SQLException
  {
        EngineConnection conn = database.getConnection();
        if (withHoldCursor == -1) {
            // Holdability not explictly set, let the
            // connection provide the default.
            return conn.prepareStatement(sqlStmt,
                    scrollType, concurType);
        }
       
        // Holdability explictly set.
        return conn.prepareStatement(sqlStmt,
                scrollType, concurType, withHoldCursor);
  }
View Full Code Here

    xaDataSource.setDatabaseName(getShortDbName());
    appendAttrString(p);
    if (attrString != null)
      xaDataSource.setConnectionAttributes(attrString);
   
    EngineConnection conn = getConnection();
    // If we have no existing connection. this is a brand new XAConnection.
    if (conn == null)
    {
      xaConnection = xaDataSource.getXAConnection(userId,password);
      ra = xaDataSource.getResourceAdapter();
      setXAResource(xaConnection.getXAResource());
    }
    else // this is just a connection reset. Close the logical connection.
    {
      conn.close();
    }
   
    // Get a new logical connection.
        // Contract between network server and embedded engine
        // is that any connection returned implements EngineConnection.
     conn = (EngineConnection) xaConnection.getConnection();
    // Client will always drive the commits so connection should
    // always be autocommit false on the server. DERBY-898/DERBY-899
    conn.setAutoCommit(false);
    setConnection(conn);   
  }
View Full Code Here

        if (password != null)
        p.put(Attribute.PASSWORD_ATTR, password);
               
        // Contract between network server and embedded engine
        // is that any connection returned implements EngineConnection.
        EngineConnection conn = (EngineConnection)
            NetworkServerControlImpl.getDriver().connect(Attribute.PROTOCOL
               + shortDbName + attrString, p);
    if (conn != null) {
      conn.setAutoCommit(false);
    }
    setConnection(conn);
  }
View Full Code Here

    void makeDummyConnection()
    {
        try {
            // Contract between network server and embedded engine
            // is that any connection returned implements EngineConnection.
            EngineConnection conn = (EngineConnection)
                NetworkServerControlImpl.getDriver().connect(Attribute.PROTOCOL
                    + shortDbName + attrString, new Properties());

            // If we succeeded in getting a connection, well just close it
            if (conn != null) {
                conn.close();
            }
        } catch (SQLException se) {} // Simply do nothing
    }
View Full Code Here

        if (password != null)
        p.put(Attribute.PASSWORD_ATTR, password);
               
        // Contract between network server and embedded engine
        // is that any connection returned implements EngineConnection.
        EngineConnection conn = (EngineConnection)
            NetworkServerControlImpl.getDriver().connect(Attribute.PROTOCOL
               + shortDbName + attrString, p);
    if (conn != null) {
      conn.setAutoCommit(false);
    }
    setConnection(conn);
  }
View Full Code Here

    void makeDummyConnection()
    {
        try {
            // Contract between network server and embedded engine
            // is that any connection returned implements EngineConnection.
            EngineConnection conn = (EngineConnection)
                NetworkServerControlImpl.getDriver().connect(Attribute.PROTOCOL
                    + shortDbName + attrString, new Properties());

            // If we succeeded in getting a connection, well just close it
            if (conn != null) {
                conn.close();
            }
        } catch (SQLException se) {} // Simply do nothing
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.jdbc.EngineConnection

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.