Class UnpooledDataSource
java.lang.Object
org.apache.ibatis.datasource.unpooled.UnpooledDataSource
- All Implemented Interfaces:
Wrapper
,CommonDataSource
,DataSource
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Boolean
private Integer
private Integer
private String
private ClassLoader
private Properties
private String
private String
private String
-
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 TypeMethodDescriptionprivate void
private Connection
doGetConnection
(String username, String password) private Connection
doGetConnection
(Properties properties) getConnection
(String username, String password) Gets the default network timeout.int
getUrl()
private void
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
-
Field Details
-
driverClassLoader
-
driverProperties
-
registeredDrivers
-
driver
-
url
-
username
-
password
-
autoCommit
-
defaultTransactionIsolationLevel
-
defaultNetworkTimeout
-
-
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
-
getLoginTimeout
public int getLoginTimeout()- Specified by:
getLoginTimeout
in interfaceCommonDataSource
-
setLogWriter
- Specified by:
setLogWriter
in interfaceCommonDataSource
-
getLogWriter
- Specified by:
getLogWriter
in interfaceCommonDataSource
-
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
-
doGetConnection
- Throws:
SQLException
-
doGetConnection
- Throws:
SQLException
-
initializeDriver
- Throws:
SQLException
-
configureConnection
- Throws:
SQLException
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLogger
in interfaceCommonDataSource
-