Package com.databricks.client.jdbc

## Class DataSource

- java.lang.Object
- - com.databricks.client.jdbc.DataSource

All Implemented Interfaces:
  `Wrapper`, `CommonDataSource`, `ConnectionPoolDataSource`, `DataSource`

    public class DataSource
    extends Object
    implements DataSource, ConnectionPoolDataSource

### Field Summary

Fields
`static JdbcLogger` `LOGGER`

### Constructor Summary

Constructors
`DataSource()`
`DataSource​(Driver driver)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Connection` `getConnection()`
`Connection` `getConnection​(String username, String password)`
`String` `getHost()`
`String` `getHttpPath()`
`int` `getLoginTimeout()`
`PrintWriter` `getLogWriter()`
`Logger` `getParentLogger()`
`String` `getPassword()`
`PooledConnection` `getPooledConnection()`
`PooledConnection` `getPooledConnection​(String user, String password)`
`int` `getPort()`
`Properties` `getProperties()`
`String` `getUrl()`
`String` `getUsername()`
`boolean` `isWrapperFor​(Class<?> iface)`
`void` `setHost​(String host)`
`void` `setHttpPath​(String httpPath)`
`void` `setLoginTimeout​(int seconds)`
`void` `setLogWriter​(PrintWriter out)`
`void` `setPassword​(String password)`
`void` `setPort​(int port)`
`void` `setProperties​(Properties properties)`
`void` `setUsername​(String username)`
`<T> T` `unwrap​(Class<T> iface)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface javax.sql.CommonDataSource

`createShardingKeyBuilder`

### Methods inherited from interface javax.sql.ConnectionPoolDataSource

`createPooledConnectionBuilder`

### Methods inherited from interface javax.sql.DataSource

`createConnectionBuilder`

### Field Detail

#### LOGGER

    public static final JdbcLogger LOGGER

### Constructor Detail

#### DataSource

    public DataSource()

#### DataSource

    public DataSource​(Driver driver)

### Method Detail

#### getConnection

    public Connection getConnection()
                             throws DatabricksSQLException

Specified by:
  `getConnection` in interface `DataSource`
Throws:
  `DatabricksSQLException`

#### getConnection

    public Connection getConnection​(String username,
                                    String password)
                             throws DatabricksSQLException

Specified by:
  `getConnection` in interface `DataSource`
Throws:
  `DatabricksSQLException`

#### getPooledConnection

    public PooledConnection getPooledConnection()
                                         throws DatabricksSQLException

Specified by:
  `getPooledConnection` in interface `ConnectionPoolDataSource`
Throws:
  `DatabricksSQLException`

#### getPooledConnection

    public PooledConnection getPooledConnection​(String user,
                                                String password)
                                         throws DatabricksSQLException

Specified by:
  `getPooledConnection` in interface `ConnectionPoolDataSource`
Throws:
  `DatabricksSQLException`

#### getLogWriter

    public PrintWriter getLogWriter()
                             throws SQLException

Specified by:
  `getLogWriter` in interface `CommonDataSource`
Specified by:
  `getLogWriter` in interface `ConnectionPoolDataSource`
Specified by:
  `getLogWriter` in interface `DataSource`
Throws:
  `SQLException`

#### setLogWriter

    public void setLogWriter​(PrintWriter out)
                      throws SQLException

Specified by:
  `setLogWriter` in interface `CommonDataSource`
Specified by:
  `setLogWriter` in interface `ConnectionPoolDataSource`
Specified by:
  `setLogWriter` in interface `DataSource`
Throws:
  `SQLException`

#### setLoginTimeout

    public void setLoginTimeout​(int seconds)

Specified by:
  `setLoginTimeout` in interface `CommonDataSource`
Specified by:
  `setLoginTimeout` in interface `ConnectionPoolDataSource`
Specified by:
  `setLoginTimeout` in interface `DataSource`

#### getLoginTimeout

    public int getLoginTimeout()

Specified by:
  `getLoginTimeout` in interface `CommonDataSource`
Specified by:
  `getLoginTimeout` in interface `ConnectionPoolDataSource`
Specified by:
  `getLoginTimeout` in interface `DataSource`

#### getParentLogger

    public Logger getParentLogger()
                           throws SQLFeatureNotSupportedException

Specified by:
  `getParentLogger` in interface `CommonDataSource`
Throws:
  `SQLFeatureNotSupportedException`

#### unwrap

    public <T> T unwrap​(Class<T> iface)
                 throws SQLException

Specified by:
  `unwrap` in interface `Wrapper`
Throws:
  `SQLException`

#### isWrapperFor

    public boolean isWrapperFor​(Class<?> iface)
                         throws SQLException

Specified by:
  `isWrapperFor` in interface `Wrapper`
Throws:
  `SQLException`

#### getUrl

    public String getUrl()

#### getUsername

    public String getUsername()

#### setUsername

    public void setUsername​(String username)

#### getPassword

    public String getPassword()

#### setPassword

    public void setPassword​(String password)

#### getHost

    public String getHost()

#### setHost

    public void setHost​(String host)

#### getPort

    public int getPort()

#### setPort

    public void setPort​(int port)

#### getHttpPath

    public String getHttpPath()

#### setHttpPath

    public void setHttpPath​(String httpPath)

#### getProperties

    public Properties getProperties()

#### setProperties

    public void setProperties​(Properties properties)