org.firebirdsql.jdbc

## Class FBDataSource

- java.lang.Object
- - org.firebirdsql.ds.RootCommonDataSource
  - - org.firebirdsql.jdbc.FBDataSource

- All Implemented Interfaces:
    java.io.Serializable, java.sql.Wrapper, javax.sql.CommonDataSource, javax.sql.DataSource

      @InternalApi
      public class FBDataSource
      extends RootCommonDataSource
      implements javax.sql.DataSource, java.io.Serializable

  The class `FBDataSource` is a ConnectionFactory for jdbc Connection objects. All work is delegated to a XcaConnectionManager.

  This data source is for internal use inside Jaybird. For a simple data source, use `FBSimpleDataSource`, for XA `FBXADataSource`.

  If you need a standalone connection pool, consider using a connection pool implementation like HikariCP, c3p0 or DBCP.

  Author:
    David Jencks
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FBDataSource(FBManagedConnectionFactory mcf, XcaConnectionManager cm)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.sql.Connection` | `getConnection()`
    `java.sql.Connection` | `getConnection(java.lang.String username, java.lang.String password)`
    `int` | `getLoginTimeout()`
    `boolean` | `isWrapperFor(java.lang.Class<?> iface)`
    `void` | `setLoginTimeout(int seconds)`
    `<T> T` | `unwrap(java.lang.Class<T> iface)`

    - ### Methods inherited from class org.firebirdsql.ds.RootCommonDataSource

      `getLogWriter, getParentLogger, setLogWriter`

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

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

    - ### Methods inherited from interface javax.sql.CommonDataSource

      `getLogWriter, getParentLogger, setLogWriter`

- - ### Constructor Detail

    - #### FBDataSource

          public FBDataSource(FBManagedConnectionFactory mcf,
                              XcaConnectionManager cm)

  - ### Method Detail

    - #### getConnection

          public java.sql.Connection getConnection()
                                            throws java.sql.SQLException

      Specified by:
        `getConnection` in interface `javax.sql.DataSource`
      Throws:
        `java.sql.SQLException`

    - #### getConnection

          public java.sql.Connection getConnection(java.lang.String username,
                                                   java.lang.String password)
                                            throws java.sql.SQLException

      Specified by:
        `getConnection` in interface `javax.sql.DataSource`
      Throws:
        `java.sql.SQLException`

    - #### setLoginTimeout

          public void setLoginTimeout(int seconds)
                               throws java.sql.SQLException

      Specified by:
        `setLoginTimeout` in interface `javax.sql.CommonDataSource`
      Throws:
        `java.sql.SQLException`

    - #### getLoginTimeout

          public int getLoginTimeout()
                              throws java.sql.SQLException

      Specified by:
        `getLoginTimeout` in interface `javax.sql.CommonDataSource`
      Throws:
        `java.sql.SQLException`

    - #### isWrapperFor

          public boolean isWrapperFor(java.lang.Class<?> iface)
                               throws java.sql.SQLException

      Specified by:
        `isWrapperFor` in interface `java.sql.Wrapper`
      Throws:
        `java.sql.SQLException`

    - #### unwrap

          public <T> T unwrap(java.lang.Class<T> iface)
                       throws java.sql.SQLException

      Specified by:
        `unwrap` in interface `java.sql.Wrapper`
      Throws:
        `java.sql.SQLException`

Copyright © 2001-2025 Jaybird (Firebird JDBC) team. All rights reserved.