Class UnpooledDataSource
- java.lang.Object
-
- org.apache.ibatis.datasource.unpooled.UnpooledDataSource
-
- All Implemented Interfaces:
Wrapper
,CommonDataSource
,DataSource
public class UnpooledDataSource extends Object implements DataSource
- Author:
- Clinton Begin, Eduardo Macarron
-
-
Constructor Summary
Constructors Constructor Description UnpooledDataSource()
UnpooledDataSource(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
-
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 Detail
-
UnpooledDataSource
public UnpooledDataSource()
-
UnpooledDataSource
public UnpooledDataSource(String driver, String url, String username, String password)
-
UnpooledDataSource
public UnpooledDataSource(String driver, String url, Properties driverProperties)
-
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 Detail
-
getConnection
public Connection getConnection() throws SQLException
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getConnection
public Connection getConnection(String username, String password) throws SQLException
- 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
public void setLogWriter(PrintWriter logWriter)
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
-
getLogWriter
public PrintWriter getLogWriter()
- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
-
getDriverClassLoader
public ClassLoader getDriverClassLoader()
-
setDriverClassLoader
public void setDriverClassLoader(ClassLoader driverClassLoader)
-
getDriverProperties
public Properties getDriverProperties()
-
setDriverProperties
public void setDriverProperties(Properties driverProperties)
-
getDriver
public String getDriver()
-
setDriver
public void setDriver(String driver)
-
getUrl
public String getUrl()
-
setUrl
public void setUrl(String url)
-
getUsername
public String getUsername()
-
setUsername
public void setUsername(String username)
-
getPassword
public String getPassword()
-
setPassword
public void setPassword(String password)
-
isAutoCommit
public Boolean isAutoCommit()
-
setAutoCommit
public void setAutoCommit(Boolean autoCommit)
-
getDefaultTransactionIsolationLevel
public Integer getDefaultTransactionIsolationLevel()
-
setDefaultTransactionIsolationLevel
public void setDefaultTransactionIsolationLevel(Integer defaultTransactionIsolationLevel)
-
getDefaultNetworkTimeout
public Integer getDefaultNetworkTimeout()
Gets the default network timeout.- Returns:
- the default network timeout
- Since:
- 3.5.2
-
setDefaultNetworkTimeout
public void setDefaultNetworkTimeout(Integer defaultNetworkTimeout)
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
public <T> T unwrap(Class<T> iface) throws SQLException
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
getParentLogger
public Logger getParentLogger()
- Specified by:
getParentLogger
in interfaceCommonDataSource
-
-