Package com.jk.core.jdbc
Class JKDriverManagerDataSource
java.lang.Object
com.jk.core.jdbc.JKDriverManagerDataSource
- All Implemented Interfaces:
Wrapper
,CommonDataSource
,DataSource
The Class JKDriverManagerDataSource.
- Author:
- Jalal
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new JK driver manager data source.JKDriverManagerDataSource
(String url, String user, String password) Instantiates a new JK driver manager data source. -
Method Summary
Modifier and TypeMethodDescriptionGets the connection.getConnection
(String username, String password) Gets the connection.int
Gets the login timeout.Gets the log writer.Gets the parent logger.Gets the password.getUrl()
Gets the url.getUser()
Gets the user.boolean
isWrapperFor
(Class<?> iface) Checks if is wrapper for.void
setLoginTimeout
(int seconds) Sets the login timeout.void
setLogWriter
(PrintWriter out) Sets the log writer.void
setPassword
(String password) Sets the password.void
Sets the url.void
Sets the user.<T> T
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
-
Constructor Details
-
JKDriverManagerDataSource
Instantiates a new JK driver manager data source.- Parameters:
url
- the urluser
- the userpassword
- the password
-
JKDriverManagerDataSource
public JKDriverManagerDataSource()Instantiates a new JK driver manager data source.
-
-
Method Details
-
getLogWriter
Gets the log writer.- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
- Returns:
- the log writer
- Throws:
SQLException
- the SQL exception
-
setLogWriter
Sets the log writer.- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
- Parameters:
out
- the new log writer- Throws:
SQLException
- the SQL exception
-
setLoginTimeout
Sets the login timeout.- Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceDataSource
- Parameters:
seconds
- the new login timeout- Throws:
SQLException
- the SQL exception
-
getLoginTimeout
Gets the login timeout.- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceDataSource
- Returns:
- the login timeout
- Throws:
SQLException
- the SQL exception
-
getParentLogger
Gets the parent logger.- Specified by:
getParentLogger
in interfaceCommonDataSource
- Returns:
- the parent logger
- Throws:
SQLFeatureNotSupportedException
- the SQL feature not supported exception
-
unwrap
Unwrap.- Specified by:
unwrap
in interfaceWrapper
- Type Parameters:
T
- the generic type- Parameters:
iface
- the iface- Returns:
- the t
- Throws:
SQLException
- the SQL exception
-
isWrapperFor
Checks if is wrapper for.- Specified by:
isWrapperFor
in interfaceWrapper
- Parameters:
iface
- the iface- Returns:
- true, if is wrapper for
- Throws:
SQLException
- the SQL exception
-
getConnection
Gets the connection.- Specified by:
getConnection
in interfaceDataSource
- Returns:
- the connection
- Throws:
SQLException
- the SQL exception
-
getConnection
Gets the connection.- Specified by:
getConnection
in interfaceDataSource
- Parameters:
username
- the usernamepassword
- the password- Returns:
- the connection
- Throws:
SQLException
- the SQL exception
-
getUrl
Gets the url.- Returns:
- the url
-
setUrl
Sets the url.- Parameters:
url
- the new url
-
getUser
Gets the user.- Returns:
- the user
-
setUser
Sets the user.- Parameters:
user
- the new user
-
getPassword
Gets the password.- Returns:
- the password
-
setPassword
Sets the password.- Parameters:
password
- the new password
-