public class BasicDataSource
extends java.lang.Object
implements javax.sql.DataSource
DataSource. Uses DriverManager to create connections.| Modifier and Type | Class and Description |
|---|---|
static class |
BasicDataSource.DriverShim
Wraps a Jdbc-Driver.
|
| Constructor and Description |
|---|
BasicDataSource(java.lang.String driverClassName,
java.lang.String dbUrl,
java.lang.String dbUser,
java.lang.String dbPassword,
DBMS dbms,
int maxPoolSize,
java.net.URL... jdbcDriverURL)
Constructor.
|
BasicDataSource(java.lang.String driverClassName,
java.lang.String dbUrl,
java.lang.String dbUser,
java.lang.String dbPassword,
int maxPoolSize,
java.io.File jdbcDriver)
Constructor.
|
BasicDataSource(java.lang.String driverClassName,
java.lang.String dbUrl,
java.lang.String dbUser,
java.lang.String dbPassword,
int maxPoolSize,
java.net.URL... jdbcDriverURL)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes all pooled connections.
|
static boolean |
findDBMSNeedsConnection(java.lang.String dbUrl) |
java.sql.Connection |
getConnection() |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password) |
int |
getLoginTimeout() |
java.io.PrintWriter |
getLogWriter() |
java.util.logging.Logger |
getParentLogger() |
boolean |
isWrapperFor(java.lang.Class<?> arg0) |
void |
setLoginTimeout(int arg0) |
void |
setLogWriter(java.io.PrintWriter arg0) |
<T> T |
unwrap(java.lang.Class<T> arg0) |
public final DBMS dbms
public BasicDataSource(java.lang.String driverClassName,
java.lang.String dbUrl,
java.lang.String dbUser,
java.lang.String dbPassword,
int maxPoolSize,
java.io.File jdbcDriver)
driverClassName - name of JDBC-driver classdbUrl - the URLdbUser - the userdbPassword - the passwordmaxPoolSize - maximum number of pooled connectionsjdbcDriver - driver jar filepublic BasicDataSource(java.lang.String driverClassName,
java.lang.String dbUrl,
java.lang.String dbUser,
java.lang.String dbPassword,
int maxPoolSize,
java.net.URL... jdbcDriverURL)
driverClassName - name of JDBC-driver classdbUrl - the URLdbUser - the userdbPassword - the passwordmaxPoolSize - maximum number of pooled connectionsjdbcDriverURL - URL of driver jar filepublic BasicDataSource(java.lang.String driverClassName,
java.lang.String dbUrl,
java.lang.String dbUser,
java.lang.String dbPassword,
DBMS dbms,
int maxPoolSize,
java.net.URL... jdbcDriverURL)
driverClassName - name of JDBC-driver classdbUrl - the URLdbUser - the userdbPassword - the passwordmaxPoolSize - maximum number of pooled connectionsdbms - the DBMSpublic void close()
public static boolean findDBMSNeedsConnection(java.lang.String dbUrl)
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic int getLoginTimeout()
throws java.sql.SQLException
getLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
getParentLogger in interface javax.sql.CommonDataSourcejava.sql.SQLFeatureNotSupportedExceptionpublic void setLogWriter(java.io.PrintWriter arg0)
throws java.sql.SQLException
setLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic void setLoginTimeout(int arg0)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic boolean isWrapperFor(java.lang.Class<?> arg0)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic <T> T unwrap(java.lang.Class<T> arg0)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionpublic java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException