Module org.firebirdsql.jaybird
Package org.firebirdsql.jdbc

# Class FBDataSource

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

All Implemented Interfaces:
  `Serializable`, `Wrapper`, `CommonDataSource`, `DataSource`

@InternalApi public class FBDataSource extends RootCommonDataSource implements DataSource, 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
Description
`FBDataSource(FBManagedConnectionFactory mcf, XcaConnectionManager cm)`

## Method Summary

Modifier and Type
Method
Description
`Connection`
`getConnection()`
`Connection`
`getConnection(String username, String password)`
`int`
`getLoginTimeout()`
`boolean`
`isWrapperFor(Class<?> iface)`
`void`
`setLoginTimeout(int seconds)`
`<T> T`
`unwrap(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

`createShardingKeyBuilder, getParentLogger`

### Methods inherited from interface javax.sql.DataSource

`createConnectionBuilder, getLogWriter, setLogWriter`

## Constructor Details

### FBDataSource

public FBDataSource(FBManagedConnectionFactory mcf, XcaConnectionManager cm)

## Method Details

### 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`

### setLoginTimeout

public void setLoginTimeout(int seconds) throws SQLException

Specified by:
  `setLoginTimeout` in interface `CommonDataSource`
Specified by:
  `setLoginTimeout` in interface `DataSource`
Throws:
  `SQLException`

### getLoginTimeout

public int getLoginTimeout() throws SQLException

Specified by:
  `getLoginTimeout` in interface `CommonDataSource`
Specified by:
  `getLoginTimeout` in interface `DataSource`
Throws:
  `SQLException`

### isWrapperFor

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

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

### unwrap

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

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