jdk/src/share/classes/javax/sql/CommonDataSource.java
author ohair
Wed, 26 May 2010 20:28:04 -0700
changeset 5551 327690766109
parent 5506 202f599c92aa
child 6540 a4ae668f6125
permissions -rw-r--r--
6956202: Fix a few missed rebranding issues, please contact lines etc. Reviewed-by: jjg, darcy, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.sql;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.sql.SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.io.PrintWriter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * Interface that defines the methods which are common between <code>DataSource</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * <code>XADataSource</code> and <code>ConnectionPoolDataSource</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
public interface CommonDataSource {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
   * <p>Retrieves the log writer for this <code>DataSource</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
   * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
   * <p>The log writer is a character output stream to which all logging
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
   * and tracing messages for this data source will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
   * printed.  This includes messages printed by the methods of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
   * object, messages printed by methods of other objects manufactured
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
   * by this object, and so on.  Messages printed to a data source
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
   * specific log writer are not printed to the log writer associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
   * with the <code>java.sql.DriverManager</code> class.  When a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
   * <code>DataSource</code> object is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
   * created, the log writer is initially null; in other words, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
   * default is for logging to be disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
   * @return the log writer for this data source or null if
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
   *        logging is disabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
   * @exception java.sql.SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
   * @see #setLogWriter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
   * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
  java.io.PrintWriter getLogWriter() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
   * <p>Sets the log writer for this <code>DataSource</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
   * object to the given <code>java.io.PrintWriter</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
   * <p>The log writer is a character output stream to which all logging
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
   * and tracing messages for this data source will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
   * printed.  This includes messages printed by the methods of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
   * object, messages printed by methods of other objects manufactured
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
   * by this object, and so on.  Messages printed to a data source-
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
   * specific log writer are not printed to the log writer associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
   * with the <code>java.sql.DriverManager</code> class. When a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
   * <code>DataSource</code> object is created the log writer is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
   * initially null; in other words, the default is for logging to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
   * disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
   * @param out the new log writer; to disable logging, set to null
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
   * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
   * @see #getLogWriter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
   * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
  void setLogWriter(java.io.PrintWriter out) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
   * <p>Sets the maximum time in seconds that this data source will wait
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
   * while attempting to connect to a database.  A value of zero
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
   * specifies that the timeout is the default system timeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
   * if there is one; otherwise, it specifies that there is no timeout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
   * When a <code>DataSource</code> object is created, the login timeout is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
   * initially zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
   * @param seconds the data source login time limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
   * @exception SQLException if a database access error occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
   * @see #getLoginTimeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
   * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
  void setLoginTimeout(int seconds) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
   * Gets the maximum time in seconds that this data source can wait
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
   * while attempting to connect to a database.  A value of zero
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
   * means that the timeout is the default system timeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
   * if there is one; otherwise, it means that there is no timeout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
   * When a <code>DataSource</code> object is created, the login timeout is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
   * initially zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
   * @return the data source login time limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
   * @exception SQLException if a database access error occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
   * @see #setLoginTimeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
   * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
  int getLoginTimeout() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
}