Subject Re: (newbie) Embedding firebird in a java app via jaybird(?)
Author judlian23
Hi Roman,

The install was fairly easy as you said. I'm not done, however. I
was trying to figure out how to connect to the database, so I
specified a path to the database figuring that if it didn't exist
firebird would create the database file for me like some of the other
embedded apps I've used. This did not seem to be the case.

Do I have to go through isql to create a database? Is there there a
more transparent/embedded method?

It seems to me that the embedded firebird version installation should
be completely transparent to the user, and databases should not be
created by another app prior to loading...doesn't it defeat the
purpose of making your server embedded? I believe I could've just as
easily used firebird through the standalone app/service installation.
Maybe I'm missing something?

Thanks for the quick reply and I hope to hear from you soon.


--- In, Roman Rokytskyy <roman@...> wrote:
> Hi,
> > I am trying to embed firebird in my java application for easy
> > deployment and to make the database transparent to the end user. As
> > the embedded firebird server is done through .dll calls, I don't know
> > if it's possible to embed firebird in a java app - I would assume it
> > would be done through the jaybird JDBC driver, but I have not seen
> > examples of it.
> >
> > Has anyone does this, does anyone know if this can be done? Are there
> > examples out there? Could someone point me in the right direction?
> Release Notes for Jaybird JDBC driver, page 10:
> "Using Firebird client library
> jdbc:firebirdsql:native:host[/port]:/path/to/db.fdb
> jdbc:firebirdsql:native://host[:port]/path/to/db.fdb
> Type 2 driver, will connect to the database using client library
> fbclient.dll or gds32.dll on Windows, and or on
> Linux). Requires correct installation of the client library.
> jdbc:firebirdsql:local:/path/to/db.fdb
> Type 2 driver in local mode. Uses client library as in previous case,
> however will not use socket communication, but rather access database
> directly. Requires correct installation of the client library.
> Embedded Server
> jdbc:firebirdsql:embedded:/path/to/db.fdb
> Similar to the Firebird client library, however fbembed.dll on Windows
> and on Linux are used. Requires correctly installed and
> configured Firebird embedded server."
> So, in fact it is easy:
> 1. place the jaybirdXX.dll in the PATH (e.g. add the current directory
> "." to your PATH)
> 2. set the FIREBIRD environment variable to point to the Firebird
> Embedded installation (fbembed.dll is not enough - you need complete
> intallation)
> 3. change the JDBC URL in your application
> 4. start Java
> Should work. If it doesn't, try specifying the
> -Djava.library.path=<path_to_jaybird_dll> parameter to JVM.
> Roman