Subject Connect to Firebird 1.5 using FBWrappingDataSource
Author marcioabt
Has anyone already made a connection to Firebird using a DataSource,
I mean, the FBWrappingDataSource class.

The following example came with JayBird but didn´t work.


public final class DataSourceExample
static public void main (String args[]) throws Exception
// Create an Firebird data source manually;

org.firebirdsql.pool.FBWrappingDataSource dataSource =
new org.firebirdsql.pool.FBWrappingDataSource();

// Set the standard properties
dataSource.setDatabase ("localhost/3050:c:/database/employee.gdb");
dataSource.setDescription ("An example database of employees");

* Following properties were not deleted in order to show differences
* between InterClient 2.01 data source implementation and Firebird

//dataSource.setDataSourceName ("Employee");
//dataSource.setPortNumber (3060);
//dataSource.setNetworkProtocol ("jdbc:interbase:");
//dataSource.setRoleName (null);

// Set the non-standard properties
//dataSource.setSuggestedCachePages (0);
//dataSource.setSweepOnConnect (false);

// this some kind of equivalent to dataSource.setNetworkProtocol
// possible values are "type4", "type2" and "embedded".


// other non-standard properties do not have setters
// you can pass any DPB parameter
dataSource.setNonStandardProperty("isc_dpb_sweep", null);
dataSource.setNonStandardProperty("isc_dpb_num_buffers", "75");

// Connect to the Firebird DataSource
try {
dataSource.setLoginTimeout (10);
java.sql.Connection c = dataSource.getConnection
("sysdba", "masterkey");
// At this point, there is no implicit driver instance
// registered with the driver manager!
System.out.println ("got connection");
c.close ();
catch (java.sql.SQLException e) {
System.out.println ("sql exception: " + e.getMessage ());

The error is:

java.sql.SQLException: Could not obtain connection during blocking
timeout (10000 ms)

at org.firebirdsql.pool.PooledConnectionQueue.take

at org.firebirdsql.pool.AbstractConnectionPool.getPooledConnection

at org.firebirdsql.pool.FBConnectionPoolDataSource.getPooledConnection

at org.firebirdsql.pool.FBConnectionPoolDataSource.getPooledConnection

at org.firebirdsql.pool.FBWrappingDataSource.getConnection

at Conectar.main(

sql exception: Could not obtain connection during blocking timeout
(10000 ms)

What am I doing wrong ? TIA

Márcio Barroso