Package javax.sql

Interface CommonDataSource

All Known Subinterfaces:
ConnectionPoolDataSource, DataSource

public interface CommonDataSource
Interface that defines the methods which are common between DataSource, XADataSource and ConnectionPoolDataSource.
Since:
1.6
  • Method Summary

    Modifier and Type Method Description
    int getLoginTimeout()
    While attempting to connect to a database, this method get the maximum time in seconds that this data source can wait.
    PrintWriter getLogWriter()
    Retrieves a log writer which is a character output stream to which all logging and tracing messages for this data source will be printed.
    void setLoginTimeout​(int seconds)
    While attempting to connect to a database, this method set the maximum time in seconds that this data source can wait.
    void setLogWriter​(PrintWriter out)
    Set a log writer which is a character output stream to which all logging and tracing messages for this data source will be printed.
  • Method Details

    • getLoginTimeout

      int getLoginTimeout() throws SQLException
      While attempting to connect to a database, this method get the maximum time in seconds that this data source can wait.
      Returns:
      An integer value to indicate the maximum time.
      Throws:
      SQLException - An exception threw when a data base access error occurs.
    • getLogWriter

      PrintWriter getLogWriter() throws SQLException
      Retrieves a log writer which is a character output stream to which all logging and tracing messages for this data source will be printed.
      Returns:
      The PrintWriter object for this DataSource.
      Throws:
      SQLException - An exception threw when a data base access error occurs.
    • setLoginTimeout

      void setLoginTimeout​(int seconds) throws SQLException
      While attempting to connect to a database, this method set the maximum time in seconds that this data source can wait.
      Parameters:
      seconds - An integer value to indicate the maximum time.
      Throws:
      SQLException - An exception threw when a data base access error occurs.
    • setLogWriter

      void setLogWriter​(PrintWriter out) throws SQLException
      Set a log writer which is a character output stream to which all logging and tracing messages for this data source will be printed.
      Parameters:
      out - The PrintWriter object for this DataSource.
      Throws:
      SQLException