|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.orion.sdata.servlet.swtservice.ConnectionPool
public class ConnectionPool
This class handles a pool of connections to a JDBC database.
Constructor Summary | |
---|---|
ConnectionPool(ApplicationContext applicationContext)
Constructs an instance of the ConnectionPool class for those
tables that do not depend on the tenant id. |
|
ConnectionPool(ApplicationContext applicationContext,
java.lang.String tenant)
Constructs an instance of the ConnectionPool class for those
tables that do depend on the tenant id. |
Method Summary | |
---|---|
void |
closeAllConnections()
Close all the connections. |
void |
free(java.sql.Connection connection)
free the connection provided by IConnectionPool.getConnection() . |
java.sql.Connection |
getConnection()
Gets a connection from the connection pool. |
JDBCDatabaseType |
getDatabaseType()
Gets the Database type which is connected to the application |
void |
run()
|
java.lang.String |
toString()
|
int |
totalConnections()
the total number of connections in the pool currently |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConnectionPool(ApplicationContext applicationContext) throws java.sql.SQLException
ConnectionPool
class for those
tables that do not depend on the tenant id.
applicationContext
- the application context.
java.sql.SQLException
- if it is thrown by the underlying systempublic ConnectionPool(ApplicationContext applicationContext, java.lang.String tenant) throws java.sql.SQLException
ConnectionPool
class for those
tables that do depend on the tenant id.
applicationContext
- the application context.tenant
- the non-null tenant id (when running in hosted) or null
java.sql.SQLException
- if it is thrown by the underlying systemMethod Detail |
---|
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface IConnectionPool
Connection
.
java.sql.SQLException
- if it is thrown by the underlying systempublic void run()
run
in interface java.lang.Runnable
public void free(java.sql.Connection connection)
IConnectionPool.getConnection()
.
free
in interface IConnectionPool
connection
- the connection to free, as returned by
getConnection
public int totalConnections()
totalConnections
in interface IConnectionPool
public void closeAllConnections()
closeAllConnections
in interface IConnectionPool
public java.lang.String toString()
This version displays information about the Connection Pool.
toString
in class java.lang.Object
public JDBCDatabaseType getDatabaseType()
getDatabaseType
in interface IConnectionPool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |