Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.4 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.database
Class ConnectionPool

    java.lang.Object
      org.jivesoftware.database.ConnectionPool

All Implemented Interfaces:
  Runnable

    public class ConnectionPool

extends Object
implements Runnable

Database connection pool.

Author:
  Jive Software

Constructor Summary
`ConnectionPool(String driver, String serverURL, String username, String password, int minCon, int maxCon, double conTimeout, boolean mysqlUseUnicode)`

Method Summary
`void` | `destroy()`
`void` | `freeConnection()`
`Connection` | `getConnection()`
`int` | `getSize()`
`void` | `run()` Housekeeping thread.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ConnectionPool

    public ConnectionPool(String driver,
                          String serverURL,
                          String username,
                          String password,
                          int minCon,
                          int maxCon,
                          double conTimeout,
                          boolean mysqlUseUnicode)
                   throws IOException

Throws:
  `IOException`

Method Detail

### getConnection

    public Connection getConnection()
                             throws SQLException

  Throws:
    `SQLException`

### freeConnection

    public void freeConnection()

### destroy

    public void destroy()
                 throws SQLException

  Throws:
    `SQLException`

### getSize

    public int getSize()

### run

    public void run()

  Housekeeping thread. This thread runs every 30 seconds and checks connections for the following conditions:

  - Connection has been open too long - it'll be closed and another connection created.
  - Connection hasn't been used for 30 seconds and the number of open connections is greater than the minimum number of connections. The connection will be closed. This is done so that the pool can shrink back to the minimum number of connections if the pool isn't being used extensively.
  - Unable to create a statement with the connection - it'll be reset.

  Specified by:
    `run` in interface `Runnable`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.4 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2007 Jive Software.