Class UnpooledDataSource
java.lang.Object
org.apache.ibatis.datasource.unpooled.UnpooledDataSource
- All Implemented Interfaces:
Wrapper
,CommonDataSource
,DataSource
- Author:
- Clinton Begin, Eduardo Macarron
-
Constructor Summary
ConstructorDescriptionUnpooledDataSource
(ClassLoader driverClassLoader, String driver, String url, String username, String password) UnpooledDataSource
(ClassLoader driverClassLoader, String driver, String url, Properties driverProperties) UnpooledDataSource
(String driver, String url, String username, String password) UnpooledDataSource
(String driver, String url, Properties driverProperties) -
Method Summary
Modifier and TypeMethodDescriptiongetConnection
(String username, String password) Gets the default network timeout.int
getUrl()
boolean
isWrapperFor
(Class<?> iface) void
setAutoCommit
(Boolean autoCommit) void
setDefaultNetworkTimeout
(Integer defaultNetworkTimeout) Sets the default network timeout value to wait for the database operation to complete.void
setDefaultTransactionIsolationLevel
(Integer defaultTransactionIsolationLevel) void
void
setDriverClassLoader
(ClassLoader driverClassLoader) void
setDriverProperties
(Properties driverProperties) void
setLoginTimeout
(int loginTimeout) void
setLogWriter
(PrintWriter logWriter) void
setPassword
(String password) void
void
setUsername
(String username) <T> T
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
-
UnpooledDataSource
public UnpooledDataSource() -
UnpooledDataSource
-
UnpooledDataSource
-
UnpooledDataSource
public UnpooledDataSource(ClassLoader driverClassLoader, String driver, String url, String username, String password) -
UnpooledDataSource
public UnpooledDataSource(ClassLoader driverClassLoader, String driver, String url, Properties driverProperties)
-
-
Method Details
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
setLoginTimeout
public void setLoginTimeout(int loginTimeout) - Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceDataSource
-
getLoginTimeout
public int getLoginTimeout()- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceDataSource
-
setLogWriter
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
-
getLogWriter
- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
-
getDriverClassLoader
-
setDriverClassLoader
-
getDriverProperties
-
setDriverProperties
-
getDriver
-
setDriver
-
getUrl
-
setUrl
-
getUsername
-
setUsername
-
getPassword
-
setPassword
-
isAutoCommit
-
setAutoCommit
-
getDefaultTransactionIsolationLevel
-
setDefaultTransactionIsolationLevel
-
getDefaultNetworkTimeout
Gets the default network timeout.- Returns:
- the default network timeout
- Since:
- 3.5.2
-
setDefaultNetworkTimeout
Sets the default network timeout value to wait for the database operation to complete. SeeConnection.setNetworkTimeout(java.util.concurrent.Executor, int)
- Parameters:
defaultNetworkTimeout
- The time in milliseconds to wait for the database operation to complete.- Since:
- 3.5.2
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLogger
in interfaceCommonDataSource
-