Java 8 XADataSource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 XADataSource class.

This code example shows how to use the following methods:getXAConnection
		try { 
			XAConnection xaConnection;
			if (username != null) {
				xaConnection = xaDataSource.getXAConnection(username, password);
			} else { 
				xaConnection = xaDataSource.getXAConnection();
			} 
			return xaConnection.getConnection();
		} catch (SQLException sex) {
			throw new DbSqlException("Unable to get connection from XA datasource", sex);
		} 
	} 
 
	public void closeConnection(Connection connection) {
		try { 
			connection.close();
		} catch (SQLException sex) {
			// ignore 
		} 
	} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getXAConnection
        DataSource ds = dsCache.get(jndiName);
        if (ds != null) {
            if (ds instanceof XADataSource) {
                XADataSource xads = (XADataSource) ds;
 
                return TransactionUtil.enlistConnection(xads.getXAConnection());
            } else { 
                return ds.getConnection();
            } 
        } 
        try { 
            if (Debug.infoOn())
                Debug.logInfo("Doing JNDI lookup for name " + jndiName, module);
            InitialContext ic = JNDIContextFactory.getInitialContext(jndiServerName);
 
            if (ic != null) {
                ds = (DataSource) ic.lookup(jndiName);
            } else { 
                Debug.logWarning("Initial Context returned was NULL for server name " + jndiServerName, module);
            } 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getXAConnection
    } 
 
    protected void setUp() throws Exception {
        include(PATH);
        xads2_ = (XADataSource) getComponent("xads");
        xacon_ = xads2_.getXAConnection();
        con_ = xacon_.getConnection();
        xares_ = new DBXAResourceImpl(con_);
    } 
 
    protected void tearDown() throws Exception {
        xacon_.close();
    } 
} 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getLoginTimeout
        this.xaDataSource = xaDataSource;
    } 
 
    public int getLoginTimeout() throws SQLException
    { 
        return xaDataSource.getLoginTimeout();
    } 
 
    public void setLoginTimeout(int seconds) throws SQLExceptionxaDataSource.setLoginTimeout(seconds);
    } 
 
    public PrintWriter getLogWriter() throws SQLException
    { 
        return xaDataSource.getLogWriter();
    } 
 
    public void setLogWriter(PrintWriter out) throws SQLException
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getXAConnection
     * @throws Exception 
     */ 
    public void testGetXAConnection() throws Exception {
        XAConnection xaCon = null;
        try { 
            xaCon = xads2_.getXAConnection();
            assertNotNull("1", xaCon);
        } finally { 
            xaCon.close();
        } 
    } 
 
    /** 
     * @throws Exception 
     */ 
    public void testGetXAConnectionWithProperties() throws Exception {
        ((XADataSourceImpl) xads2_).addProperty("name", "value");
        XAConnection xaCon = null;
        try { 
            xaCon = xads2_.getXAConnection();
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getXAConnection
     * @throws Exception 
     */ 
    public void testGetConnectionAndGetXAResource() throws Exception {
        XAConnection xaCon = null;
        try { 
            xaCon = xads2_.getXAConnection();
            assertNotNull("1", xaCon.getConnection());
            assertNotNull("2", xaCon.getXAResource());
        } finally { 
            xaCon.close();
        } 
    } 
 
    protected void setUp() throws Exception {
        include(PATH);
    } 
} 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getLoginTimeout
        xaDataSource.setLoginTimeout(seconds);
    } 
 
    @Override 
    public int getLoginTimeout() throws SQLException {
        return xaDataSource.getLoginTimeout();
    } 
 
    @Override 
    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
        return getParentLogger(); 
    } 
 
    // DataSource implementation 
    public Connection getConnection() throws SQLException {
        return arjunaJDBC2Driver.connect(txDriverUrl, properties);
    } 
 
    public Connection getConnection(String u, String p) throws SQLException {
        Properties dbProperties = new Properties(properties);
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getXAConnection
		} 
	} 
 
	@Override 
	public XAConnection getXAConnection() throws SQLException {
		return _theXADataSource.getXAConnection();
	} 
 
	@Override 
	public XAConnection getXAConnection(String user, String password) throws SQLException {
		return _theXADataSource.getXAConnection( user, password );
	} 
 
	@Override 
	public PrintWriter getLogWriter() throws SQLException {
		return _theXADataSource.getLogWriter();
	} 
 
	@Override 
	public void setLogWriter(PrintWriter out) throws SQLException {
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setLoginTimeout
        Assert.fail("shutdown engine not implemened");
    } 
     
    public void setLoginTimeout( int seconds ) throws SQLExceptionds.setLoginTimeout( seconds );
    } 
     
    public int getLoginTimeout() throws SQLException
    { 
        return ds.getLoginTimeout();
    } 
     
    public String getDatabaseName() {
        String databaseName=null;
        try { 
            // get the physical database name 
            databaseName = (String) JDBCDataSource.getBeanProperty(ds, "databaseName");
        } catch (Exception e) {
            e.printStackTrace();
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getLoginTimeout
    } 
 
    @Override 
    public int getLoginTimeout() throws SQLException
    { 
        return xaDataSource.getLoginTimeout();
    } 
 
    @Override 
    public void setLoginTimeout(int seconds) throws SQLExceptionxaDataSource.setLoginTimeout(seconds);
    } 
 
    @Override 
    public PrintWriter getLogWriter() throws SQLException
    { 
        return xaDataSource.getLogWriter();
    } 
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 XADataSource Methods: