Class UnpooledDataSource
java.lang.Object
org.apache.ibatis.datasource.unpooled.UnpooledDataSource
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
- Author:
- Clinton Begin, Eduardo Macarron
-
Constructor Summary
ConstructorsConstructorDescriptionUnpooledDataSource(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.intgetUrl()booleanisWrapperFor(Class<?> iface) voidsetAutoCommit(Boolean autoCommit) voidsetDefaultNetworkTimeout(Integer defaultNetworkTimeout) Sets the default network timeout value to wait for the database operation to complete.voidsetDefaultTransactionIsolationLevel(Integer defaultTransactionIsolationLevel) voidvoidsetDriverClassLoader(ClassLoader driverClassLoader) voidsetDriverProperties(Properties driverProperties) voidsetLoginTimeout(int loginTimeout) voidsetLogWriter(PrintWriter logWriter) voidsetPassword(String password) voidvoidsetUsername(String username) <T> TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods 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:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
setLoginTimeout
public void setLoginTimeout(int loginTimeout) - Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource
-
getLoginTimeout
public int getLoginTimeout()- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource
-
getLogWriter
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin 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:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource
-