|
SPT RWT Application API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.rwt.ConnectionManager
public class ConnectionManager
A manager used to globally maintain a single means of connecting to a
database. Connections are obtained through DataSource
or DriverManager.
© Copyright 2007 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
private String |
dataSource
The name of the data source to use to obtain connections. |
private ConnectionParameters |
parameters
The connection parameters to use to obtain connections. |
| Constructor Summary | |
|---|---|
private |
ConnectionManager()
Default constructor. |
|
ConnectionManager(ConnectionParameters parameters)
Create a new instance of the class configured to use the specified parameters. |
|
ConnectionManager(String dataSource)
Create a new instance of the class configured to use the specifiedj dataSource. |
| Method Summary | |
|---|---|
void |
close(Connection connection)
Close the specified connection. |
String |
getDataSource()
Returns dataSource. |
ConnectionParameters |
getParameters()
Returns parameters. |
String |
getTitle()
Return a name indicating the current connection source. |
Connection |
open()
Open a connection to the database using the currently active dataSource or parameters. |
void |
setDataSource(String dataSource)
Set dataSource. |
void |
setParameters(ConnectionParameters parameters)
Set parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private String dataSource
private ConnectionParameters parameters
| Constructor Detail |
|---|
private ConnectionManager()
public ConnectionManager(String dataSource)
dataSource.
dataSource - The dataSource value to use.public ConnectionManager(ConnectionParameters parameters)
parameters.
parameters - The parameters to use.| Method Detail |
|---|
public Connection open()
throws ConnectionException
dataSource or parameters.
ConnectionException - If errors are encountered while fetching
the connection to the database. Can also be thrown if this instance
has not been initialised through setDataSource(java.lang.String) or setParameters(com.sptci.rwt.ConnectionParameters).ConnectionFactory.open( String ),
ConnectionFactory.open( ConnectionParameters )public void close(Connection connection)
ConnectionFactory.close(java.sql.Connection)public String getDataSource()
dataSource.
public void setDataSource(String dataSource)
dataSource. If a valid string was specified, sets parameters to null.
dataSource - The value to set.public ConnectionParameters getParameters()
parameters.
public void setParameters(ConnectionParameters parameters)
parameters. If valid parameters were specified, sets
dataSource to null.
parameters - The value to set.public String getTitle()
|
SPT RWT Application API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||