com.holonplatform.jdbc.internal

## Class DefaultBasicDataSource

- java.lang.Object
- - com.holonplatform.jdbc.internal.DefaultBasicDataSource

- All Implemented Interfaces:
    BasicDataSource, Closeable, AutoCloseable, Wrapper, CommonDataSource, DataSource

      public class DefaultBasicDataSource
      extends Object
      implements BasicDataSource

  Default `BasicDataSource` implementation.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DefaultBasicDataSource.DefaultBuilder` Default `Builder` implementation.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.jdbc.BasicDataSource

      `BasicDataSource.Builder`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBasicDataSource()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `Connection` | `getConnection()`
    `Connection` | `getConnection(String username, String password)`
    `Properties` | `getConnectionProperties()` Connection properties to be passed to the Driver
    `int` | `getLoginTimeout()` Returns 0, indicating the default system timeout is to be used.
    `PrintWriter` | `getLogWriter()` LogWriter methods are not supported.
    `Logger` | `getParentLogger()`
    `String` | `getPassword()` JDBC connection password
    `String` | `getUrl()` JDBC URL to use to use for connections
    `String` | `getUsername()` JDBC connection username
    `boolean` | `isWrapperFor(Class<?> iface)`
    `void` | `setConnectionProperties(Properties connectionProperties)` Specify arbitrary connection properties as key/value pairs to be passed to the Driver.
    `void` | `setDriverClass(Class<? extends Driver> driverClass)` Set JDBC Driver class to use
    `void` | `setDriverClassName(String driverClassName)` Set JDBC Driver class name to use
    `void` | `setLoginTimeout(int seconds)` Setting a login timeout is not supported.
    `void` | `setLogWriter(PrintWriter out)` LogWriter methods are not supported.
    `void` | `setPassword(String password)` Set JDBC connection password
    `void` | `setUrl(String url)` Set JDBC URL to use for connections
    `void` | `setUsername(String username)` Set JDBC connection username
    `<T> T` | `unwrap(Class<T> iface)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.jdbc.BasicDataSource

      `builder`

- - ### Constructor Detail

    - #### DefaultBasicDataSource

          public DefaultBasicDataSource()

  - ### Method Detail

    - #### setUrl

          public void setUrl(String url)

      Set JDBC URL to use for connections
      Parameters:
        `url` - Connection URL
      See Also:
        `Driver.connect(String, java.util.Properties)`

    - #### getUrl

          public String getUrl()

      JDBC URL to use to use for connections
      Returns:
        JDBC connection URL

    - #### setUsername

          public void setUsername(String username)

      Set JDBC connection username
      Parameters:
        `username` - JDBC connection username
      See Also:
        `Driver.connect(String, java.util.Properties)`

    - #### getUsername

          public String getUsername()

      JDBC connection username
      Returns:
        JDBC connection username

    - #### setPassword

          public void setPassword(String password)

      Set JDBC connection password
      Parameters:
        `password` - JDBC connection password
      See Also:
        `Driver.connect(String, java.util.Properties)`

    - #### getPassword

          public String getPassword()

      JDBC connection password
      Returns:
        JDBC connection password

    - #### setDriverClassName

          public void setDriverClassName(String driverClassName)

      Set JDBC Driver class name to use
      Parameters:
        `driverClassName` - JDBC Driver class name

    - #### setDriverClass

          public void setDriverClass(Class<? extends Driver> driverClass)

      Set JDBC Driver class to use
      Parameters:
        `driverClass` - JDBC Driver class

    - #### setConnectionProperties

          public void setConnectionProperties(Properties connectionProperties)

      Specify arbitrary connection properties as key/value pairs to be passed to the Driver.
      Parameters:
        `connectionProperties` - Connection properties
      See Also:
        `Driver.connect(String, java.util.Properties)`

    - #### getConnectionProperties

          public Properties getConnectionProperties()

      Connection properties to be passed to the Driver
      Returns:
        Connection properties

    - #### getLogWriter

          public PrintWriter getLogWriter()
                                   throws SQLException

      LogWriter methods are not supported.
      Specified by:
        `getLogWriter` in interface `CommonDataSource`
      Throws:
        `SQLException`

    - #### setLogWriter

          public void setLogWriter(PrintWriter out)
                            throws SQLException

      LogWriter methods are not supported.
      Specified by:
        `setLogWriter` in interface `CommonDataSource`
      Throws:
        `SQLException`

    - #### setLoginTimeout

          public void setLoginTimeout(int seconds)
                               throws SQLException

      Setting a login timeout is not supported.
      Specified by:
        `setLoginTimeout` in interface `CommonDataSource`
      Throws:
        `SQLException`

    - #### getLoginTimeout

          public int getLoginTimeout()
                              throws SQLException

      Returns 0, indicating the default system timeout is to be used.
      Specified by:
        `getLoginTimeout` in interface `CommonDataSource`
      Returns:
        0 (default timeout)
      Throws:
        `SQLException`

    - #### getParentLogger

          public Logger getParentLogger()
                                 throws SQLFeatureNotSupportedException

      Specified by:
        `getParentLogger` in interface `CommonDataSource`
      Throws:
        `SQLFeatureNotSupportedException`

    - #### unwrap

          public <T> T unwrap(Class<T> iface)
                       throws SQLException

      Specified by:
        `unwrap` in interface `Wrapper`
      Throws:
        `SQLException`

    - #### isWrapperFor

          public boolean isWrapperFor(Class<?> iface)
                               throws SQLException

      Specified by:
        `isWrapperFor` in interface `Wrapper`
      Throws:
        `SQLException`

    - #### getConnection

          public Connection getConnection()
                                   throws SQLException

      Specified by:
        `getConnection` in interface `DataSource`
      Throws:
        `SQLException`

    - #### getConnection

          public Connection getConnection(String username,
                                          String password)
                                   throws SQLException

      Specified by:
        `getConnection` in interface `DataSource`
      Throws:
        `SQLException`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © 2019 The Holon Platform. All rights reserved.