Author: bayard Date: Tue Jun 12 11:25:30 2007 New Revision: 546583 URL: http://svn.apache.org/viewvc?view=rev&rev=546583 Log: Adding the Javadoc to state that getLoginTimeout and setLoginTimeout are NOT supported by BasicDataSource as per DBCP-218
Modified: jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java Modified: jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java?view=diff&rev=546583&r1=546582&r2=546583 ============================================================================== --- jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java (original) +++ jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java Tue Jun 12 11:25:30 2007 @@ -882,8 +882,7 @@ /** - * <strong>BasicDataSource does NOT support this method. - * </strong> + * <strong>BasicDataSource does NOT support this method. </strong> * * @param username Database user on whose behalf the Connection * is being made @@ -902,6 +901,8 @@ /** + * <strong>BasicDataSource does NOT support this method. </strong> + * * <p>Returns the login timeout (in seconds) for connecting to the database. * </p> * <p>Calls [EMAIL PROTECTED] #createDataSource()}, so has the side effect @@ -913,7 +914,10 @@ * @return login timeout in seconds */ public int getLoginTimeout() throws SQLException { - return createDataSource().getLoginTimeout(); + // This method isn't supported by the PoolingDataSource returned by + // the createDataSource + throw new UnsupportedOperationException("Not supported by BasicDataSource"); + //return createDataSource().getLoginTimeout(); } @@ -932,6 +936,8 @@ /** + * <strong>BasicDataSource does NOT support this method. </strong> + * * <p>Set the login timeout (in seconds) for connecting to the * database.</p> * <p> @@ -939,10 +945,15 @@ * of initializing the connection pool.</p> * * @param loginTimeout The new login timeout, or zero for no timeout + * @throws UnsupportedOperationException If the DataSource implementation + * does not support the login timeout feature. * @throws SQLException if a database access error occurs */ public void setLoginTimeout(int loginTimeout) throws SQLException { - createDataSource().setLoginTimeout(loginTimeout); + // This method isn't supported by the PoolingDataSource returned by + // the createDataSource + throw new UnsupportedOperationException("Not supported by BasicDataSource"); + //createDataSource().setLoginTimeout(loginTimeout); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]