|
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.ConnectionFactory
public class ConnectionFactory
A factory used to obtain database connections. Database connections can
be obtained through DataSource or DriverManager.
© Copyright 2007 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
private static Map<String,DataSource> |
cache
A map used to maintain DataSource references to
avoid having to look it up each time. |
| Constructor Summary | |
|---|---|
ConnectionFactory()
|
|
| Method Summary | |
|---|---|
static void |
close(Connection connection)
Close the specified connection. |
static Connection |
open(ConnectionParameters parameters)
Fetch a connection to the database defined by the specified parameters object. |
static Connection |
open(String name)
Fetch a connection to the database via a relative DataSource name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Map<String,DataSource> cache
DataSource references to
avoid having to look it up each time.
| Constructor Detail |
|---|
public ConnectionFactory()
| Method Detail |
|---|
public static Connection open(ConnectionParameters parameters)
throws ConnectionException
parameters - The value object with the connection parameters.
ConnectionException - If errors are encountered while fetching
the connection.
public static Connection open(String name)
throws ConnectionException
DataSource name.
name - The name of the datasource from which to fetch a connection.
ConnectionException - If errors are encountered while fetching
the connection.public static final void close(Connection connection)
connection - The connection that is to be closed.CloseJDBCResources.close( Connection )
|
SPT RWT Application API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||