We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
com.vaadin.data.util.sqlcontainer.connection.
Class J2EEConnectionPool
java.lang.Object
com.vaadin.data.util.sqlcontainer.connection.J2EEConnectionPool
All Implemented Interfaces:
- extends Object
- implements JDBCConnectionPool
public class J2EEConnectionPool
See Also:
Constructor Summary | |
---|---|
J2EEConnectionPool(DataSource dataSource)
|
|
J2EEConnectionPool(String dataSourceJndiName)
|
Method Summary | |
---|---|
void |
destroy()
Destroys the connection pool: close() is called an all the connections in the pool, whether available or reserved. |
void |
releaseConnection(Connection conn)
Releases a connection that was retrieved earlier. |
Connection |
reserveConnection()
Retrieves a connection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
J2EEConnectionPool
public J2EEConnectionPool(DataSource dataSource)
J2EEConnectionPool
public J2EEConnectionPool(String dataSourceJndiName)
Method Detail |
---|
reserveConnection
public Connection reserveConnection()
throws SQLException
- Specified by:
reserveConnection
in interfaceJDBCConnectionPool
- Returns:
- a usable connection to the database
- Throws:
SQLException
Description copied from interface: JDBCConnectionPool
Retrieves a connection.
releaseConnection
public void releaseConnection(Connection conn)
- Specified by:
releaseConnection
in interfaceJDBCConnectionPool
- Parameters:
conn
- Connection to be released
Description copied from interface: JDBCConnectionPool
Releases a connection that was retrieved earlier. Note that depending on implementation, the transaction possibly open in the connection may or may not be rolled back.
destroy
public void destroy()
- Specified by:
destroy
in interfaceJDBCConnectionPool
Description copied from interface: JDBCConnectionPool
Destroys the connection pool: close() is called an all the connections in the pool, whether available or reserved. This method was added to fix PostgreSQL -related issues with connections that were left hanging 'idle'.