Java DataSource getConnection(final DataSource ds, final boolean autoCommit)

Here you can find the source of getConnection(final DataSource ds, final boolean autoCommit)

Description

get Connection

License

Open Source License

Declaration

public static Connection getConnection(final DataSource ds, final boolean autoCommit) throws SQLException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.Connection;

import java.sql.SQLException;

import javax.sql.DataSource;

public class Main {
    public static Connection getConnection(final DataSource ds, final boolean autoCommit) throws SQLException {
        final Connection conn = ds.getConnection();
        if (conn.getAutoCommit() != autoCommit) {
            conn.setAutoCommit(autoCommit);
        }//from   w ww. java 2s.co  m
        return conn;
    }
}

Related

  1. execute(DataSource ds, String sql, Object... args)
  2. execute(String execute, DataSource datasource)
  3. executeQuery(DataSource dataSource, String... queries)
  4. getConnection(CommonDataSource dataSource)
  5. getConnection(DataSource dataSource)
  6. getConnectionFromDataSource(DataSource ds)
  7. getDatabaseName(DataSource dataSource)
  8. getDataSource(String jndi)
  9. getDataSource(String jndiName)