CommonDataSource.java revision 0
0N/A * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A * Interface that defines the methods which are common between <code>DataSource</code>, 0N/A * <code>XADataSource</code> and <code>ConnectionPoolDataSource</code>. 0N/A * <p>Retrieves the log writer for this <code>DataSource</code> 0N/A * <p>The log writer is a character output stream to which all logging 0N/A * and tracing messages for this data source will be 0N/A * printed. This includes messages printed by the methods of this 0N/A * object, messages printed by methods of other objects manufactured 0N/A * by this object, and so on. Messages printed to a data source 0N/A * specific log writer are not printed to the log writer associated 0N/A * with the <code>java.sql.DriverManager</code> class. When a 0N/A * <code>DataSource</code> object is 0N/A * created, the log writer is initially null; in other words, the 0N/A * default is for logging to be disabled. 0N/A * @return the log writer for this data source or null if 0N/A * logging is disabled 0N/A * @exception java.sql.SQLException if a database access error occurs 0N/A * @see #setLogWriter 0N/A * <p>Sets the log writer for this <code>DataSource</code> 0N/A * object to the given <code>java.io.PrintWriter</code> object. 0N/A * <p>The log writer is a character output stream to which all logging 0N/A * and tracing messages for this data source will be 0N/A * printed. This includes messages printed by the methods of this 0N/A * object, messages printed by methods of other objects manufactured 0N/A * by this object, and so on. Messages printed to a data source- 0N/A * specific log writer are not printed to the log writer associated 0N/A * with the <code>java.sql.DriverManager</code> class. When a 0N/A * <code>DataSource</code> object is created the log writer is 0N/A * initially null; in other words, the default is for logging to be 0N/A * @param out the new log writer; to disable logging, set to null 0N/A * @exception SQLException if a database access error occurs 0N/A * @see #getLogWriter 0N/A * <p>Sets the maximum time in seconds that this data source will wait 0N/A * while attempting to connect to a database. A value of zero 0N/A * specifies that the timeout is the default system timeout 0N/A * if there is one; otherwise, it specifies that there is no timeout. 0N/A * When a <code>DataSource</code> object is created, the login timeout is 0N/A * @param seconds the data source login time limit 0N/A * @exception SQLException if a database access error occurs. 0N/A * @see #getLoginTimeout 0N/A * Gets the maximum time in seconds that this data source can wait 0N/A * while attempting to connect to a database. A value of zero 0N/A * means that the timeout is the default system timeout 0N/A * if there is one; otherwise, it means that there is no timeout. 0N/A * When a <code>DataSource</code> object is created, the login timeout is 0N/A * @return the data source login time limit 0N/A * @exception SQLException if a database access error occurs. 0N/A * @see #setLoginTimeout