Subject JayBird + Firebird Embedded on Win 7 x64
Author denixx.baykin
I decided to transfer my training project with the MySQL database on an embedded DBMS that can work with stored procedures.
Firebird Embedded seem to know how to work with stored procedures.
But I could not see what JayBird requires of me.
Training project was developed in the IDE Eclipse.
OS Win 7 x64.
The project folder for the test run (creating a database connection) is in D:\Java\Projects\FirebirdEmbedded.

Here is the text of test connection:
package test;

import java.sql.*;

public class Main {

public static void main(String[] args) throws ClassNotFoundException, SQLException {
Class.forName("org.firebirdsql.jdbc.FBDriver");

Connection bd = DriverManager.getConnection("jdbc:firebirdsql:embedded:database.fdb");
Statement st = bd.createStatement();
st.execute("create table if not exists 'TABLE1' ('name1' int, 'name2' text, 'name3' text);");
st.execute("insert into 'TABLE1' ('name1', 'name2', 'name3') values (1, 'name1', 'name2'); ");
st.execute("insert into 'TABLE1' ('name1', 'name2', 'name3') values (2, 'name3', 'name4'); ");
st.execute("insert into 'TABLE1' ('name1', 'name2', 'name3') values (3, 'name5', 'name6');");
ResultSet rs = st.executeQuery("select * from TABLE1");
while (rs.next())
{
System.out.print (rs.getString(1)+" ");
System.out.print (rs.getString(2)+" ");
System.out.println(rs.getString(3));
}
}
}

When starting displays exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Java\Projects\FirebirdEmbedded\jaybird21.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.firebirdsql.gds.impl.jni.JniGDSImpl.initJNIBridge(JniGDSImpl.java:5
at org.firebirdsql.gds.impl.jni.JniGDSImpl.<clinit>(JniGDSImpl.java:23)
at org.firebirdsql.gds.impl.jni.EmbeddedGDSFactoryPlugin.getGDS(EmbeddedGDSFactoryPlugin.java:40)
at org.firebirdsql.gds.impl.GDSFactory.getGDSForType(GDSFactory.java:219)
at org.firebirdsql.jca.FBManagedConnectionFactory.getGDS(FBManagedConnectionFactory.java:117)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:125)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at test.Main.main(Main.java:16)

What I did:
Copied the contents of the folder D:\Downloads\Firebird-2.5.0.26074-0_Win32_embed in the folder D:\Java\Projects\FirebirdEmbedded.
Copied the contents of the folder D:\Downloads\Jaybird-2.1.6JDK_1.6 in the folder D:\Java\Projects\FirebirdEmbedded.
Created a global variable "FIREBIRD" with the contents of "D:\Java\Projects\FirebirdEmbedded".
Added to the global variable "PATH" text ";D:\Java\Projects\FirebirdEmbedded".

Also were performed the following manipulations:
I downloaded Dependency Walker, checked whether all the dependent libraries are in folder.
Looked and added msvcr71.dll in the folder with the project.
Still does not run.
Moved all this stuff from Win7 x64 to a virtual machine on Win XP x32.
It seems to work there.
Why in one system does not work, and in other works?

After I was advised to use the x64 Firebird Embedded.
I downloaded it, deleted all the old in project, again copied the contents of the folder
D:\Downloads\Firebird-2.5.0.26074-0_x64_embed
in a folder
D:\Java\Projects\FirebirdEmbedded.
Copied the contents of the folder
D:\Downloads\Jaybird-2.1.6JDK_1.6
in a folder
D:\Java\Projects\FirebirdEmbedded.

And... do not run with the same exception,
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Java\Projects\FirebirdEmbedded\jaybird21.dll: Can't find dependent libraries...

Renamed fbembed.dll in fbclient.dll, has deleted global variable "FIREBIRD", from "PATH" has deleted the text ";D:\Java\Projects\FirebirdEmbedded". All the same it is not launched.

Who can help?