Package org.teiid.jdbc

Examples of org.teiid.jdbc.ConnectionImpl


      Properties props = new Properties();
      props.setProperty(BaseDataSource.VDB_NAME, STD_DATABASE_NAME);
      props.setProperty(BaseDataSource.VDB_VERSION, String.valueOf(STD_DATABASE_VERSION));
      props.setProperty(BaseDataSource.USER_NAME, "metamatrixadmin"); //$NON-NLS-1$
      stub(mock.getLogonResult()).toReturn(new LogonResult(new SessionToken(1, "metamatrixadmin"), STD_DATABASE_NAME,STD_DATABASE_VERSION , "fake")); //$NON-NLS-1$
      return new ConnectionImpl(mock, props, serverUrl);
    }
View Full Code Here


        assertEquals(false, getMMConnection().isReadOnly());
    }

    /** test setReadOnly on Connection */
    public void testSetReadOnly1() throws Exception {
      ConnectionImpl conn = getMMConnection();
        conn.setReadOnly(true);
        assertEquals(true, conn.isReadOnly());
    }
View Full Code Here

        assertEquals(true, conn.isReadOnly());
    }

    /** test setReadOnly on Connection during a transaction */
    public void testSetReadOnly2() throws Exception {
      ConnectionImpl conn = getMMConnection();
        conn.setAutoCommit(false);
        try {
            conn.setReadOnly(true);
            fail("Error Expected"); //$NON-NLS-1$
        } catch (SQLException e) {
            // error expected
        }
    }
View Full Code Here

      assertEquals("Parameter is not found at index 0.", e.getMessage());
    }
  }

  private CallableStatementImpl getCallableStatement() throws SQLException {
    ConnectionImpl conn = Mockito.mock(ConnectionImpl.class);
    ServerConnection sc = Mockito.mock(ServerConnection.class);
   
    Mockito.stub(sc.getLogonResult()).toReturn(new LogonResult());
    Mockito.stub(conn.getServerConnection()).toReturn(sc);
   
    CallableStatementImpl mmcs = new CallableStatementImpl(conn, "{?=call x(?)}", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
    return mmcs;
  }
View Full Code Here

TOP

Related Classes of org.teiid.jdbc.ConnectionImpl

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.