More Javadoc fixes.

This commit is contained in:
Erik C. Thauvin 2004-03-17 23:19:02 +00:00
parent 409b1bf7ee
commit 122b14c8f4
5 changed files with 119 additions and 105 deletions

View file

@ -64,7 +64,7 @@ public class SimplePool implements Runnable {
/** /**
* Creates a new Connection Broker. * Creates a new Connection Pool.
* *
* @param driver JDBC driver. e.g. 'oracle.jdbc.driver.OracleDriver' * @param driver JDBC driver. e.g. 'oracle.jdbc.driver.OracleDriver'
* @param jdbcUrl JDBC connect string. e.g. 'jdbc:oracle:thin:@203.92.21.109:1526:orcl' * @param jdbcUrl JDBC connect string. e.g. 'jdbc:oracle:thin:@203.92.21.109:1526:orcl'
@ -75,6 +75,8 @@ public class SimplePool implements Runnable {
* @param maxConnTime Time in days between connection resets. (Reset does a basic cleanup) * @param maxConnTime Time in days between connection resets. (Reset does a basic cleanup)
* @param maxCheckoutSeconds Max time a connection can be checked out before being recycled. Zero value turns option * @param maxCheckoutSeconds Max time a connection can be checked out before being recycled. Zero value turns option
* off, default is 60 seconds. * off, default is 60 seconds.
*
* @throws IOException If the pool cannot be created.
*/ */
public SimplePool(String driver, String jdbcUrl, String user, public SimplePool(String driver, String jdbcUrl, String user,
String password, int minConns, int maxConns, double maxConnTime, int maxCheckoutSeconds) String password, int minConns, int maxConns, double maxConnTime, int maxCheckoutSeconds)
@ -280,6 +282,8 @@ public class SimplePool implements Runnable {
* If the min number of threads are ever exhausted, new threads are added up the the max thread count. Finally, if * If the min number of threads are ever exhausted, new threads are added up the the max thread count. Finally, if
* all threads are in use, this method waits 2 seconds and tries again, up to ten times. After that, it returns a * all threads are in use, this method waits 2 seconds and tries again, up to ten times. After that, it returns a
* null. * null.
*
* @return A connection from the pool.
*/ */
public Connection getConnection() { public Connection getConnection() {
@ -362,6 +366,10 @@ public class SimplePool implements Runnable {
/** /**
* Returns the local JDBC ID for a connection. * Returns the local JDBC ID for a connection.
*
* @param conn The connection object.
*
* @return The local JDBC ID for the connection.
*/ */
public int idOfConnection(Connection conn) { public int idOfConnection(Connection conn) {
int match = -1; int match = -1;
@ -384,6 +392,10 @@ public class SimplePool implements Runnable {
/** /**
* Frees a connection. Replaces connection back into the main pool for reuse. * Frees a connection. Replaces connection back into the main pool for reuse.
*
* @param conn The connection object.
*
* @return A status or empty string.
*/ */
public String freeConnection(Connection conn) { public String freeConnection(Connection conn) {
String res = ""; String res = "";
@ -403,6 +415,10 @@ public class SimplePool implements Runnable {
/** /**
* Returns the age of a connection -- the time since it was handed out to an application. * Returns the age of a connection -- the time since it was handed out to an application.
*
* @param conn The connection object.
*
* @return The age of the connection.
*/ */
public long getAge(Connection conn) { // Returns the age of the connection in millisec. public long getAge(Connection conn) { // Returns the age of the connection in millisec.
int thisconn = idOfConnection(conn); int thisconn = idOfConnection(conn);
@ -536,6 +552,8 @@ public class SimplePool implements Runnable {
* This method could be reduced to return a counter that is maintained by all methods that update connStatus. * This method could be reduced to return a counter that is maintained by all methods that update connStatus.
* However, it is more efficient to do it this way because: Updating the counter would put an additional burden on * However, it is more efficient to do it this way because: Updating the counter would put an additional burden on
* the most frequently used methods; in comparison, this method is rarely used (although essential). * the most frequently used methods; in comparison, this method is rarely used (although essential).
*
* @return The number of connections in use.
*/ */
public int getUseCount() { public int getUseCount() {
int useCount = 0; int useCount = 0;
@ -551,6 +569,8 @@ public class SimplePool implements Runnable {
/** /**
* Returns the number of connections in the dynamic pool. * Returns the number of connections in the dynamic pool.
*
* @return The number of connections in the pool.
*/ */
public int getSize() { public int getSize() {
return currConnections; return currConnections;

View file

@ -67,8 +67,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#setAutoCommit(boolean)}. * See {@link java.sql.Connection#setAutoCommit(boolean)}.
*
* @see java.sql.Connection#setAutoCommit(boolean)
*/ */
public void setAutoCommit(boolean autoCommit) public void setAutoCommit(boolean autoCommit)
throws SQLException { throws SQLException {
@ -77,8 +75,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#getAutoCommit}. * See {@link java.sql.Connection#getAutoCommit}.
*
* @see java.sql.Connection#getAutoCommit
*/ */
public boolean getAutoCommit() public boolean getAutoCommit()
throws SQLException { throws SQLException {
@ -87,8 +83,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#setCatalog(String)}. * See {@link java.sql.Connection#setCatalog(String)}.
*
* @see java.sql.Connection#setCatalog(String)
*/ */
public void setCatalog(String catalog) public void setCatalog(String catalog)
throws SQLException { throws SQLException {
@ -97,8 +91,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#getCatalog()}. * See {@link java.sql.Connection#getCatalog()}.
*
* @see java.sql.Connection#getCatalog()
*/ */
public String getCatalog() public String getCatalog()
throws SQLException { throws SQLException {
@ -107,8 +99,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#isClosed}. * See {@link java.sql.Connection#isClosed}.
*
* @see java.sql.Connection#isClosed
*/ */
public boolean isClosed() public boolean isClosed()
throws SQLException { throws SQLException {
@ -117,8 +107,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#setHoldability(int)}. * See {@link java.sql.Connection#setHoldability(int)}.
*
* @see java.sql.Connection#setHoldability(int)
*/ */
public void setHoldability(int holdability) public void setHoldability(int holdability)
throws SQLException { throws SQLException {
@ -127,8 +115,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#getHoldability}. * See {@link java.sql.Connection#getHoldability}.
*
* @see java.sql.Connection#getHoldability
*/ */
public int getHoldability() public int getHoldability()
throws SQLException { throws SQLException {
@ -137,8 +123,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#getMetaData}. * See {@link java.sql.Connection#getMetaData}.
*
* @see java.sql.Connection#getMetaData
*/ */
public DatabaseMetaData getMetaData() public DatabaseMetaData getMetaData()
throws SQLException { throws SQLException {
@ -147,8 +131,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#setReadOnly(boolean)}. * See {@link java.sql.Connection#setReadOnly(boolean)}.
*
* @see java.sql.Connection#setReadOnly(boolean)
*/ */
public void setReadOnly(boolean readOnly) public void setReadOnly(boolean readOnly)
throws SQLException { throws SQLException {
@ -157,8 +139,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#isReadOnly}. * See {@link java.sql.Connection#isReadOnly}.
*
* @see java.sql.Connection#isReadOnly
*/ */
public boolean isReadOnly() public boolean isReadOnly()
throws SQLException { throws SQLException {
@ -167,8 +147,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#setSavepoint}. * See {@link java.sql.Connection#setSavepoint}.
*
* @see java.sql.Connection#setSavepoint
*/ */
public Savepoint setSavepoint() public Savepoint setSavepoint()
throws SQLException { throws SQLException {
@ -177,8 +155,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#setSavepoint(String)}. * See {@link java.sql.Connection#setSavepoint(String)}.
*
* @see java.sql.Connection#setSavepoint(String)
*/ */
public Savepoint setSavepoint(String savepoint) public Savepoint setSavepoint(String savepoint)
throws SQLException { throws SQLException {
@ -187,8 +163,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#setTransactionIsolation(int)}. * See {@link java.sql.Connection#setTransactionIsolation(int)}.
*
* @see java.sql.Connection#setTransactionIsolation(int)
*/ */
public void setTransactionIsolation(int level) public void setTransactionIsolation(int level)
throws SQLException { throws SQLException {
@ -197,8 +171,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#getTransactionIsolation}. * See {@link java.sql.Connection#getTransactionIsolation}.
*
* @see java.sql.Connection#getTransactionIsolation
*/ */
public int getTransactionIsolation() public int getTransactionIsolation()
throws SQLException { throws SQLException {
@ -207,8 +179,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#setTypeMap(Map)}. * See {@link java.sql.Connection#setTypeMap(Map)}.
*
* @see java.sql.Connection#setTypeMap(Map)
*/ */
public void setTypeMap(Map map) public void setTypeMap(Map map)
throws SQLException { throws SQLException {
@ -217,8 +187,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#getTypeMap}. * See {@link java.sql.Connection#getTypeMap}.
*
* @see java.sql.Connection#getTypeMap
*/ */
public Map getTypeMap() public Map getTypeMap()
throws SQLException { throws SQLException {
@ -227,8 +195,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#getWarnings}. * See {@link java.sql.Connection#getWarnings}.
*
* @see java.sql.Connection#getWarnings
*/ */
public SQLWarning getWarnings() public SQLWarning getWarnings()
throws SQLException { throws SQLException {
@ -237,8 +203,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#clearWarnings}. * See {@link java.sql.Connection#clearWarnings}.
*
* @see java.sql.Connection#clearWarnings
*/ */
public void clearWarnings() public void clearWarnings()
throws SQLException { throws SQLException {
@ -247,8 +211,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#close}. * See {@link java.sql.Connection#close}.
*
* @see java.sql.Connection#close
*/ */
public void close() public void close()
throws SQLException { throws SQLException {
@ -257,8 +219,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#commit}. * See {@link java.sql.Connection#commit}.
*
* @see java.sql.Connection#commit
*/ */
public void commit() public void commit()
throws SQLException { throws SQLException {
@ -267,8 +227,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#createStatement}. * See {@link java.sql.Connection#createStatement}.
*
* @see java.sql.Connection#createStatement
*/ */
public Statement createStatement() public Statement createStatement()
throws SQLException { throws SQLException {
@ -277,8 +235,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#createStatement(int, int)}. * See {@link java.sql.Connection#createStatement(int, int)}.
*
* @see java.sql.Connection#createStatement(int, int)
*/ */
public Statement createStatement(int resultSetType, int resultSetConcurrency) public Statement createStatement(int resultSetType, int resultSetConcurrency)
throws SQLException { throws SQLException {
@ -287,8 +243,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#createStatement(int, int, int)}. * See {@link java.sql.Connection#createStatement(int, int, int)}.
*
* @see java.sql.Connection#createStatement(int, int, int)
*/ */
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
throws SQLException { throws SQLException {
@ -297,8 +251,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#nativeSQL(String)}. * See {@link java.sql.Connection#nativeSQL(String)}.
*
* @see java.sql.Connection#nativeSQL(String)
*/ */
public String nativeSQL(String sql) public String nativeSQL(String sql)
throws SQLException { throws SQLException {
@ -307,8 +259,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#prepareCall(String)}. * See {@link java.sql.Connection#prepareCall(String)}.
*
* @see java.sql.Connection#prepareCall(String)
*/ */
public CallableStatement prepareCall(String sql) public CallableStatement prepareCall(String sql)
throws SQLException { throws SQLException {
@ -317,8 +267,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#prepareCall(String, int, int)}. * See {@link java.sql.Connection#prepareCall(String, int, int)}.
*
* @see java.sql.Connection#prepareCall(String, int, int)
*/ */
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
throws SQLException { throws SQLException {
@ -327,8 +275,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#prepareCall(String, int, int, int)}. * See {@link java.sql.Connection#prepareCall(String, int, int, int)}.
*
* @see java.sql.Connection#prepareCall(String, int, int, int)
*/ */
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
throws SQLException { throws SQLException {
@ -337,8 +283,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#prepareStatement(String)}. * See {@link java.sql.Connection#prepareStatement(String)}.
*
* @see java.sql.Connection#prepareStatement(String)
*/ */
public PreparedStatement prepareStatement(String sql) public PreparedStatement prepareStatement(String sql)
throws SQLException { throws SQLException {
@ -347,8 +291,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#prepareStatement(String)}. * See {@link java.sql.Connection#prepareStatement(String)}.
*
* @see java.sql.Connection#prepareStatement(String)
*/ */
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
throws SQLException { throws SQLException {
@ -357,8 +299,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#prepareStatement(String, int, int)}. * See {@link java.sql.Connection#prepareStatement(String, int, int)}.
*
* @see java.sql.Connection#prepareStatement(String, int, int)
*/ */
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
throws SQLException { throws SQLException {
@ -367,8 +307,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#prepareStatement(String, int, int, int)}. * See {@link java.sql.Connection#prepareStatement(String, int, int, int)}.
*
* @see java.sql.Connection#prepareStatement(String, int, int, int)
*/ */
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
throws SQLException { throws SQLException {
@ -377,8 +315,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#prepareStatement(String, int[])}. * See {@link java.sql.Connection#prepareStatement(String, int[])}.
*
* @see java.sql.Connection#prepareStatement(String, int[])
*/ */
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) public PreparedStatement prepareStatement(String sql, int[] columnIndexes)
throws SQLException { throws SQLException {
@ -387,8 +323,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#prepareStatement(String, String[])}. * See {@link java.sql.Connection#prepareStatement(String, String[])}.
*
* @see java.sql.Connection#prepareStatement(String, String[])
*/ */
public PreparedStatement prepareStatement(String sql, String[] columnNames) public PreparedStatement prepareStatement(String sql, String[] columnNames)
throws SQLException { throws SQLException {
@ -397,8 +331,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#releaseSavepoint(Savepoint)}. * See {@link java.sql.Connection#releaseSavepoint(Savepoint)}.
*
* @see java.sql.Connection#releaseSavepoint(Savepoint)
*/ */
public void releaseSavepoint(Savepoint savepoint) public void releaseSavepoint(Savepoint savepoint)
throws SQLException { throws SQLException {
@ -407,8 +339,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#rollback}. * See {@link java.sql.Connection#rollback}.
*
* @see java.sql.Connection#rollback
*/ */
public void rollback() public void rollback()
throws SQLException { throws SQLException {
@ -417,8 +347,6 @@ public class SimplePoolConnection implements Connection {
/** /**
* See {@link java.sql.Connection#rollback(Savepoint)}. * See {@link java.sql.Connection#rollback(Savepoint)}.
*
* @see java.sql.Connection#rollback(Savepoint)
*/ */
public void rollback(Savepoint savepoint) public void rollback(Savepoint savepoint)
throws SQLException { throws SQLException {

View file

@ -80,8 +80,6 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* See {@link javax.sql.DataSource#getConnection()}. * See {@link javax.sql.DataSource#getConnection()}.
*
* @see javax.sql.DataSource#getConnection()
*/ */
public Connection getConnection() throws SQLException { public Connection getConnection() throws SQLException {
@ -99,8 +97,6 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* See {@link javax.sql.DataSource#getConnection(String, String)}. * See {@link javax.sql.DataSource#getConnection(String, String)}.
*
* @see javax.sql.DataSource#getConnection(String, String)
*/ */
public Connection getConnection(String username, String password) public Connection getConnection(String username, String password)
throws SQLException { throws SQLException {
@ -111,8 +107,6 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* See {@link javax.sql.DataSource#setLogWriter(PrintWriter)}. * See {@link javax.sql.DataSource#setLogWriter(PrintWriter)}.
*
* @see javax.sql.DataSource#setLogWriter(PrintWriter)
*/ */
public void setLogWriter(PrintWriter out) throws SQLException { public void setLogWriter(PrintWriter out) throws SQLException {
logWriter = out; logWriter = out;
@ -120,8 +114,6 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* See {@link javax.sql.DataSource#getLogWriter}. * See {@link javax.sql.DataSource#getLogWriter}.
*
* @see javax.sql.DataSource#getLogWriter
*/ */
public PrintWriter getLogWriter() { public PrintWriter getLogWriter() {
return logWriter; return logWriter;
@ -129,16 +121,12 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* See {@link javax.sql.DataSource#setLoginTimeout(int)}. * See {@link javax.sql.DataSource#setLoginTimeout(int)}.
*
* @see javax.sql.DataSource#setLoginTimeout(int)
*/ */
public void setLoginTimeout(int seconds) throws SQLException { public void setLoginTimeout(int seconds) throws SQLException {
} }
/** /**
* See {@link javax.sql.DataSource#getLoginTimeout}. * See {@link javax.sql.DataSource#getLoginTimeout}.
*
* @see javax.sql.DataSource#getLoginTimeout
*/ */
public int getLoginTimeout() { public int getLoginTimeout() {
return 0; return 0;
@ -154,13 +142,21 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* Sets the JDBC driver. * Sets the JDBC driver.
*
* @param driver The JDBC driver. e.g. 'com.mysql.jdbc.Driver'
*
* @see #getDriver()
*/ */
public void setDriver(String val) { public void setDriver(String driver) {
driver = val; this.driver = driver;
} }
/** /**
* Gets the JDBC driver. * Gets the JDBC driver.
*
* @return The JDBC driver string.
*
* @see #setDriver(String)
*/ */
public String getDriver() { public String getDriver() {
return driver; return driver;
@ -168,13 +164,21 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* Sets the JDBC connect string. * Sets the JDBC connect string.
*
* @param jdbcUrl The JDBC connection URL string. e.g. 'jdbc:mysql://localhost:3306/dbname'
*
* @see #getJdbcUrl()
*/ */
public void setJdbcUrl(String val) { public void setJdbcUrl(String jdbcUrl) {
jdbcUrl = val; this.jdbcUrl = jdbcUrl;
} }
/** /**
* Sets the JDBC connect string. * Gets the JDBC connect string.
*
* @return The JDBC connection URL string.
*
* @see #setJdbcUrl(String)
*/ */
public String getJdbcUrl() { public String getJdbcUrl() {
return jdbcUrl; return jdbcUrl;
@ -182,13 +186,21 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* Sets the database login name. * Sets the database login name.
*
* @param user The database login name. e.g. 'Scott'
*
* @see #getUser()
*/ */
public void setUser(String val) { public void setUser(String user) {
user = val; this.user = user;
} }
/** /**
* Gets the database login name. * Gets the database login name.
*
* @return The login name string.
*
* @see #setUser(String)
*/ */
public String getUser() { public String getUser() {
return user; return user;
@ -196,13 +208,21 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* Sets the database password. * Sets the database password.
*
* @param password The database password. e.g. 'Tiger'
*
* @see #getPassword()
*/ */
public void setPassword(String val) { public void setPassword(String password) {
password = val; this.password = password;
} }
/** /**
* Gets the database password. * Gets the database password.
*
* @return The password string.
*
* @see #setPassword(String)
*/ */
public String getPassword() { public String getPassword() {
return password; return password;
@ -210,13 +230,21 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* Sets the minimum number of connections to start with. * Sets the minimum number of connections to start with.
*
* @param minConns The minimum number of connections.
*
* @see #getMinConns()
*/ */
public void setMinConns(String val) { public void setMinConns(String minConns) {
minConns = val; this.minConns = minConns;
} }
/** /**
* Gets the minimum number of connections to start with. * Gets the minimum number of connections to start with.
*
* @return The minimum number of connections string.
*
* @see #setMinConns(String)
*/ */
public String getMinConns() { public String getMinConns() {
return minConns; return minConns;
@ -224,13 +252,21 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* Sets the maximum number of connections in dynamic pool. * Sets the maximum number of connections in dynamic pool.
*
* @param maxConns The maximum number of connections.
*
* @see #getMaxConns()
*/ */
public void setMaxConns(String val) { public void setMaxConns(String maxConns) {
maxConns = val; this.maxConns = maxConns;
} }
/** /**
* Gets the maximum number of connections in dynamic pool. * Gets the maximum number of connections in dynamic pool.
*
* @return The maximum number of connection string.
*
* @see #setMaxConns(String)
*/ */
public String getMaxConns() { public String getMaxConns() {
return maxConns; return maxConns;
@ -238,13 +274,21 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* Sets the time in days between connection resets. * Sets the time in days between connection resets.
*
* @param maxConnTime The maximum connection time.
*
* @see #getMaxConnTime()
*/ */
public void setMaxConnTime(String val) { public void setMaxConnTime(String maxConnTime) {
maxConnTime = val; this.maxConnTime = maxConnTime;
} }
/** /**
* Gets the time in days between connection resets. * Gets the time in days between connection resets.
*
* @return The maximum connection time string.
*
* @see #setMaxConnTime(String)
*/ */
public String getMaxConnTime() { public String getMaxConnTime() {
return maxConnTime; return maxConnTime;
@ -252,13 +296,21 @@ public class SimplePoolDataSource implements DataSource {
/** /**
* Sets the max time a connection can be checked out before being recycled. * Sets the max time a connection can be checked out before being recycled.
*
* @param maxCheckoutSeconds The maximum number of seconds to wait before recycling a connection.
*
* @see #getMaxCheckoutSeconds()
*/ */
public void setMaxCheckoutSeconds(String val) { public void setMaxCheckoutSeconds(String maxCheckoutSeconds) {
maxCheckoutSeconds = val; this.maxCheckoutSeconds = maxCheckoutSeconds;
} }
/** /**
* Sets the max time a connection can be checked out before being recycled. * Gets the max time a connection can be checked out before being recycled.
*
* @return The maximum checkout time string.
*
* @see #setMaxCheckoutSeconds(String)
*/ */
public String getMaxCheckoutSeconds() { public String getMaxCheckoutSeconds() {
return maxCheckoutSeconds; return maxCheckoutSeconds;

View file

@ -72,6 +72,20 @@ public class SimplePoolServlet extends HttpServlet {
/** /**
* Initializes the connection pool. * Initializes the connection pool.
* <p/>
* The required intialization parameters are:
* <p/>
* <ul>
* <li><code>varName</code> &ndash; Name of the variable used to hold a reference to the {@link SimplePoolDataSource}.</li>
* <li><code>driver</code> &ndash; JDBC driver. e.g. 'oracle.jdbc.driver.OracleDriver'</li>
* <li><code>jdbcUrl</code> &ndash; JDBC connect string. e.g. 'jdbc:oracle:thin:@203.92.21.109:1526:orcl'</li>
* <li><code>user</code> &ndash; Database login name. e.g. 'Scott'</li>
* <li><code>password</code> &ndash; Database password. e.g. 'Tiger'</li>
* <li><code>minConns</code> &ndash; Minimum number of connections to start with.</li>
* <li><code>maxConns</code> &ndash; Maximum number of connections in dynamic pool.</li>
* <li><code>maxConnTime</code> &ndash; Time in days between connection resets.</li>
* <li><code>maxCheckoutSeconds</code> &ndash; Max time a connection can be checked out before being recycled.</li>
* </ul>
* *
* @see javax.servlet.http.HttpServlet#init(ServletConfig) * @see javax.servlet.http.HttpServlet#init(ServletConfig)
*/ */