|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object DataSource
DataSource implements the javax.sql.DataSource interface using the driver manager.
Constructor Summary | |
DataSource(String name,
String url,
String username,
String password,
int poolSize)
Construct a DataSource with the specified URL, username, and password. |
Method Summary | |
void |
close()
Shut down the connection pool. |
Connection |
getConnection()
Returns a connection to this data source. |
Connection |
getConnection(String username,
String password)
Returns a connection to this data source. |
int |
getLoginTimeout()
Returns the login timeout. |
PrintWriter |
getLogWriter()
Returns the log writer. |
void |
setLoginTimeout(int i)
Set the login timeout. |
void |
setLogWriter(PrintWriter w)
Set the log writer. |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DataSource(String name, String url, String username, String password, int poolSize)
url
- the URL for connecting to the database using JDBC.username
- the username for authenticating a connection.password
- the password for authenticating a connection.poolSize
- the maximum number of connections in the pool.Method Detail |
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
- if the driver manager fails to open a connection.public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
username
- the username (ignored).password
- the password (ignored).
SQLException
- if the driver manager fails to open a connection.public int getLoginTimeout()
getLoginTimeout
in interface DataSource
public PrintWriter getLogWriter()
getLogWriter
in interface DataSource
public void setLoginTimeout(int i)
setLoginTimeout
in interface DataSource
i
- the new login timeout.public void setLogWriter(PrintWriter w)
setLogWriter
in interface DataSource
w
- the new log writer.public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |