Package com.appslandia.common.jdbc
Class DataSourceImpl
- java.lang.Object
-
- com.appslandia.common.base.InitializeObject
-
- com.appslandia.common.jdbc.DataSourceImpl
-
- All Implemented Interfaces:
InitializeSupport,java.sql.Wrapper,javax.sql.CommonDataSource,javax.sql.DataSource
public class DataSourceImpl extends InitializeObject implements javax.sql.DataSource
- Author:
- Loc Ha
-
-
Field Summary
-
Fields inherited from class com.appslandia.common.base.InitializeObject
mutex
-
-
Constructor Summary
Constructors Constructor Description DataSourceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.sql.ConnectiongetConnection()java.sql.ConnectiongetConnection(java.lang.String username, java.lang.String password)intgetLoginTimeout()java.io.PrintWritergetLogWriter()java.util.logging.LoggergetParentLogger()java.lang.StringgetPassword()java.lang.StringgetUrl()java.lang.StringgetUserName()protected voidinit()booleanisWrapperFor(java.lang.Class<?> iface)DataSourceImplload(java.io.File file)DataSourceImplload(java.io.InputStream is)DataSourceImplload(java.io.Reader r)DataSourceImplload(java.lang.String file)DataSourceImplloadProps(java.util.Map<java.lang.String,java.lang.String> props)voidsetLoginTimeout(int seconds)voidsetLogWriter(java.io.PrintWriter out)DataSourceImplsetPassword(java.lang.String password)DataSourceImplsetUrl(java.lang.String url)DataSourceImplsetUserName(java.lang.String userName)<T> Tunwrap(java.lang.Class<T> iface)-
Methods inherited from class com.appslandia.common.base.InitializeObject
assertNotInitialized, destroy, initialize
-
-
-
-
Method Detail
-
init
protected void init() throws java.lang.Exception- Specified by:
initin classInitializeObject- Throws:
java.lang.Exception
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLException- Specified by:
getConnectionin 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:
getConnectionin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
getLoginTimeout
public int getLoginTimeout() throws java.sql.SQLException- Specified by:
getLoginTimeoutin interfacejavax.sql.CommonDataSource- Specified by:
getLoginTimeoutin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
getLogWriter
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException- Specified by:
getLogWriterin interfacejavax.sql.CommonDataSource- Specified by:
getLogWriterin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
getParentLogger
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException- Specified by:
getParentLoggerin interfacejavax.sql.CommonDataSource- Throws:
java.sql.SQLFeatureNotSupportedException
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException- Specified by:
isWrapperForin interfacejava.sql.Wrapper- Throws:
java.sql.SQLException
-
setLoginTimeout
public void setLoginTimeout(int seconds) throws java.sql.SQLException- Specified by:
setLoginTimeoutin interfacejavax.sql.CommonDataSource- Specified by:
setLoginTimeoutin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
setLogWriter
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException- Specified by:
setLogWriterin interfacejavax.sql.CommonDataSource- Specified by:
setLogWriterin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
unwrap
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException- Specified by:
unwrapin interfacejava.sql.Wrapper- Throws:
java.sql.SQLException
-
load
public DataSourceImpl load(java.io.InputStream is)
-
load
public DataSourceImpl load(java.io.Reader r)
-
load
public DataSourceImpl load(java.io.File file)
-
load
public DataSourceImpl load(java.lang.String file)
-
loadProps
public DataSourceImpl loadProps(java.util.Map<java.lang.String,java.lang.String> props)
-
getUrl
public java.lang.String getUrl()
-
setUrl
public DataSourceImpl setUrl(java.lang.String url)
-
getUserName
public java.lang.String getUserName()
-
setUserName
public DataSourceImpl setUserName(java.lang.String userName)
-
getPassword
public java.lang.String getPassword()
-
setPassword
public DataSourceImpl setPassword(java.lang.String password)
-
-