Package com.clickhouse.jdbc
Class ClickHouseDataSource
- java.lang.Object
-
- com.clickhouse.jdbc.JdbcWrapper
-
- com.clickhouse.jdbc.ClickHouseDataSource
-
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
public class ClickHouseDataSource extends JdbcWrapper implements DataSource
-
-
Field Summary
Fields Modifier and Type Field Description protected ClickHouseJdbcUrlParser.ConnectionInfoconnInfoprotected ClickHouseDriverdriverprotected intloginTimeoutSecondsprotected PrintWriterprintWriter
-
Constructor Summary
Constructors Constructor Description ClickHouseDataSource(String url)ClickHouseDataSource(String url, Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClickHouseConnectiongetConnection()ClickHouseConnectiongetConnection(String username, String password)StringgetDatabase()StringgetHost()intgetLoginTimeout()PrintWritergetLogWriter()LoggergetParentLogger()intgetPort()voidsetLoginTimeout(int seconds)voidsetLogWriter(PrintWriter out)-
Methods inherited from class com.clickhouse.jdbc.JdbcWrapper
isWrapperFor, unwrap
-
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.DataSource
createConnectionBuilder
-
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
-
-
-
Field Detail
-
driver
protected final ClickHouseDriver driver
-
connInfo
protected final ClickHouseJdbcUrlParser.ConnectionInfo connInfo
-
printWriter
protected PrintWriter printWriter
-
loginTimeoutSeconds
protected int loginTimeoutSeconds
-
-
Constructor Detail
-
ClickHouseDataSource
public ClickHouseDataSource(String url) throws SQLException
- Throws:
SQLException
-
ClickHouseDataSource
public ClickHouseDataSource(String url, Properties properties) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
getConnection
public ClickHouseConnection getConnection() throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
public ClickHouseConnection getConnection(String username, String password) throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getHost
public String getHost()
-
getPort
public int getPort()
-
getDatabase
public String getDatabase()
-
getLogWriter
public PrintWriter getLogWriter() throws SQLException
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Throws:
SQLException
-
setLogWriter
public void setLogWriter(PrintWriter out) throws SQLException
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Throws:
SQLException
-
setLoginTimeout
public void setLoginTimeout(int seconds) throws SQLException- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getLoginTimeout
public int getLoginTimeout() throws SQLException- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getParentLogger
public Logger getParentLogger() throws SQLFeatureNotSupportedException
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-
-