Class UnpooledDataSource
- java.lang.Object
-
- org.apache.ibatis.datasource.unpooled.UnpooledDataSource
-
- All Implemented Interfaces:
java.sql.Wrapper
,javax.sql.CommonDataSource
,javax.sql.DataSource
public class UnpooledDataSource extends java.lang.Object implements javax.sql.DataSource
- Author:
- Clinton Begin, Eduardo Macarron
-
-
Constructor Summary
Constructors Constructor Description UnpooledDataSource()
UnpooledDataSource(java.lang.ClassLoader driverClassLoader, java.lang.String driver, java.lang.String url, java.lang.String username, java.lang.String password)
UnpooledDataSource(java.lang.ClassLoader driverClassLoader, java.lang.String driver, java.lang.String url, java.util.Properties driverProperties)
UnpooledDataSource(java.lang.String driver, java.lang.String url, java.lang.String username, java.lang.String password)
UnpooledDataSource(java.lang.String driver, java.lang.String url, java.util.Properties driverProperties)
-
Method Summary
Modifier and Type Method Description java.sql.Connection
getConnection()
java.sql.Connection
getConnection(java.lang.String username, java.lang.String password)
java.lang.Integer
getDefaultNetworkTimeout()
java.lang.Integer
getDefaultTransactionIsolationLevel()
java.lang.String
getDriver()
java.lang.ClassLoader
getDriverClassLoader()
java.util.Properties
getDriverProperties()
int
getLoginTimeout()
java.io.PrintWriter
getLogWriter()
java.util.logging.Logger
getParentLogger()
java.lang.String
getPassword()
java.lang.String
getUrl()
java.lang.String
getUsername()
java.lang.Boolean
isAutoCommit()
boolean
isWrapperFor(java.lang.Class<?> iface)
void
setAutoCommit(java.lang.Boolean autoCommit)
void
setDefaultNetworkTimeout(java.lang.Integer defaultNetworkTimeout)
Sets the default network timeout value to wait for the database operation to complete.void
setDefaultTransactionIsolationLevel(java.lang.Integer defaultTransactionIsolationLevel)
void
setDriver(java.lang.String driver)
void
setDriverClassLoader(java.lang.ClassLoader driverClassLoader)
void
setDriverProperties(java.util.Properties driverProperties)
void
setLoginTimeout(int loginTimeout)
void
setLogWriter(java.io.PrintWriter logWriter)
void
setPassword(java.lang.String password)
void
setUrl(java.lang.String url)
void
setUsername(java.lang.String username)
<T> T
unwrap(java.lang.Class<T> iface)
-
-
-
Constructor Detail
-
UnpooledDataSource
public UnpooledDataSource()
-
UnpooledDataSource
public UnpooledDataSource(java.lang.String driver, java.lang.String url, java.lang.String username, java.lang.String password)
-
UnpooledDataSource
public UnpooledDataSource(java.lang.String driver, java.lang.String url, java.util.Properties driverProperties)
-
UnpooledDataSource
public UnpooledDataSource(java.lang.ClassLoader driverClassLoader, java.lang.String driver, java.lang.String url, java.lang.String username, java.lang.String password)
-
UnpooledDataSource
public UnpooledDataSource(java.lang.ClassLoader driverClassLoader, java.lang.String driver, java.lang.String url, java.util.Properties driverProperties)
-
-
Method Detail
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLException
- Specified by:
getConnection
in interfacejavax.sql.DataSource
- Throws:
java.sql.SQLException
-
getConnection
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
- Specified by:
getConnection
in interfacejavax.sql.DataSource
- Throws:
java.sql.SQLException
-
setLoginTimeout
public void setLoginTimeout(int loginTimeout)
- Specified by:
setLoginTimeout
in interfacejavax.sql.CommonDataSource
- Specified by:
setLoginTimeout
in interfacejavax.sql.DataSource
-
getLoginTimeout
public int getLoginTimeout()
- Specified by:
getLoginTimeout
in interfacejavax.sql.CommonDataSource
- Specified by:
getLoginTimeout
in interfacejavax.sql.DataSource
-
setLogWriter
public void setLogWriter(java.io.PrintWriter logWriter)
- Specified by:
setLogWriter
in interfacejavax.sql.CommonDataSource
- Specified by:
setLogWriter
in interfacejavax.sql.DataSource
-
getLogWriter
public java.io.PrintWriter getLogWriter()
- Specified by:
getLogWriter
in interfacejavax.sql.CommonDataSource
- Specified by:
getLogWriter
in interfacejavax.sql.DataSource
-
getDriverClassLoader
public java.lang.ClassLoader getDriverClassLoader()
-
setDriverClassLoader
public void setDriverClassLoader(java.lang.ClassLoader driverClassLoader)
-
getDriverProperties
public java.util.Properties getDriverProperties()
-
setDriverProperties
public void setDriverProperties(java.util.Properties driverProperties)
-
getDriver
public java.lang.String getDriver()
-
setDriver
public void setDriver(java.lang.String driver)
-
getUrl
public java.lang.String getUrl()
-
setUrl
public void setUrl(java.lang.String url)
-
getUsername
public java.lang.String getUsername()
-
setUsername
public void setUsername(java.lang.String username)
-
getPassword
public java.lang.String getPassword()
-
setPassword
public void setPassword(java.lang.String password)
-
isAutoCommit
public java.lang.Boolean isAutoCommit()
-
setAutoCommit
public void setAutoCommit(java.lang.Boolean autoCommit)
-
getDefaultTransactionIsolationLevel
public java.lang.Integer getDefaultTransactionIsolationLevel()
-
setDefaultTransactionIsolationLevel
public void setDefaultTransactionIsolationLevel(java.lang.Integer defaultTransactionIsolationLevel)
-
getDefaultNetworkTimeout
public java.lang.Integer getDefaultNetworkTimeout()
- Since:
- 3.5.2
-
setDefaultNetworkTimeout
public void setDefaultNetworkTimeout(java.lang.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(java.lang.Class<T> iface) throws java.sql.SQLException
- Specified by:
unwrap
in interfacejava.sql.Wrapper
- Throws:
java.sql.SQLException
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
- Specified by:
isWrapperFor
in interfacejava.sql.Wrapper
- Throws:
java.sql.SQLException
-
getParentLogger
public java.util.logging.Logger getParentLogger()
- Specified by:
getParentLogger
in interfacejavax.sql.CommonDataSource
-
-