com.sage.orion.sdata.servlet.swtservice
Interface IConnectionPool

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
ConnectionPool

public interface IConnectionPool
extends java.lang.Runnable

The IConnectionPool provides the interface for a pool of JDBC connections to a database


Method Summary
 void closeAllConnections()
          Close all the connections.
 void free(java.sql.Connection connection)
          free the connection provided by getConnection().
 java.sql.Connection getConnection()
          Gets a connection from the connection pool.
 JDBCDatabaseType getDatabaseType()
          Gets the Database type which is connected to the application
 int totalConnections()
          the total number of connections in the pool currently
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getConnection

java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Gets a connection from the connection pool. Note: When finished using this connection, the caller MUST call free on the connection. Otherwise the connection will not be freed from the connection and there will be a resource leak.

Returns:
a Connection
Throws:
java.sql.SQLException - on occasions

free

void free(java.sql.Connection connection)
free the connection provided by getConnection().

Parameters:
connection - the connection to free, as returned by getConnection

closeAllConnections

void closeAllConnections()
Close all the connections. Use with caution: be sure no connections are in use before calling. Note that you are not required to call this when done with a ConnectionPool, since connections are guaranteed to be closed when garbage collected. But this method gives more control regarding when the connections are closed.


totalConnections

int totalConnections()
the total number of connections in the pool currently

Returns:
the total number of connections in the pool currently

getDatabaseType

JDBCDatabaseType getDatabaseType()
Gets the Database type which is connected to the application

Returns:
databaseType


Copyright © 2011 Sage Software, Inc. All rights reserved.