# 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

## Constructor Summary

Constructors
Constructor
Description
`DataSource()`
`DataSource(Driver driver)`

## Method Summary

Modifier and Type
Method
Description
`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 user)`
`<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`

## Constructor Details

### DataSource

public DataSource()

### DataSource

public DataSource(Driver driver)

## Method Details

### 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 user)

### 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)