public class StandardDataSource extends CoreDataSource implements DataSource
This class is generic in the sense that it does not rely upon anything other than standard Java APIs. It uses java.sql.DriverManager and preconfigured properties to construct a JDBC connection. Important : networkProtocol, portNumber, serverName are not used. Please use instead the url property.
logWriter, password, user| Modifier | Constructor and Description |
|---|---|
|
StandardDataSource()
Constructors
|
protected |
StandardDataSource(Driver drv) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Connection |
getConnection() |
Connection |
getConnection(String u,
String p) |
String |
getDriverName()
return the name of the driver
|
Object |
getObjectInstance(Object refObj,
Name name,
Context nameCtx,
Hashtable env)
Methods inherited from ObjectFactory
|
Logger |
getParentLogger() |
Reference |
getReference()
Methods inherited from referenceable
|
int |
getTransactionIsolation()
return the transaction isolation level defined for the current database
|
String |
getUrl()
return the url of the database
|
int |
hashCode() |
boolean |
isWrapperFor(Class<?> iface) |
void |
setDriverName(String driverName)
set the name of the jdbc driver
|
void |
setTransactionIsolation(int level)
set the level of the transaction isolation for the current database
|
void |
setUrl(String url)
set the database url
|
String |
toString() |
<T> T |
unwrap(Class<T> iface) |
getDescription, getLoginTimeout, getLogWriter, getPassword, getThreadFactory, getUser, isDebug, isVerbose, setDebug, setDescription, setLoginTimeout, setLogWriter, setPassword, setThreadFactory, setUser, setVerbose, shutdownclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetLoginTimeout, getLogWriter, setLoginTimeout, setLogWriterpublic StandardDataSource()
protected StandardDataSource(Driver drv) throws SQLException
SQLExceptionpublic String getDriverName()
public String getUrl()
public void setDriverName(String driverName) throws SQLException
driverName - the string representation of the jdbc driver nameSQLExceptionpublic void setUrl(String url)
url - the string representation of the database urlpublic void setTransactionIsolation(int level)
level - the integer levelpublic int getTransactionIsolation()
public Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String u, String p) throws SQLException
getConnection in interface DataSourceu - p - SQLExceptionpublic Reference getReference() throws NamingException
getReference in interface ReferenceablegetReference in class CoreDataSourceNamingExceptionpublic Object getObjectInstance(Object refObj, Name name, Context nameCtx, Hashtable env) throws Exception
getObjectInstance in interface ObjectFactorygetObjectInstance in class CoreDataSourceExceptionpublic String toString()
toString in class CoreDataSourcepublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionCopyright © 2014–2015. All rights reserved.