Subject | Re: [Firebird-Java] Testing Jaybird 3 with Embedded Database on Windows |
---|---|
Author | Mark Rotteveel |
Post date | 2016-11-27T09:33:02Z |
On 26-11-2016 14:40, Peter Borissow peter.borissow@...
[Firebird-Java] wrote:
found; even if for example fbclient will get loaded. I will change the
logging in beta 2 to log this only on debug, and only log on error if
none of the libraries could be loaded.
never need to load the driver explicitly. A notable exception are web
applications if the driver is deployed with the application instead of
in the server itself.
it is necessary (and maybe a number of other libraries). The simplest
way to use embedded is to use the Firebird 3 zip kit, unzip it in a
folder, and specify the jna.library.path system property to point to
that folder.
So for example if I have unzipped Firebird 3 to D:\Firebird3\
Then use
java -Djna.library.path=D:\Firebird3\ -cp
.;jaybird-full-3.0.0-beta-1.jar;jna-4.2.2.jar YourMainClass
Just make sure the Firebird 3 you use has the same bitness as your java.exe
I just noticed that jna-4.2.2.jar is not included in the distribution
zip, you can download it from
https://maven.java.net/content/repositories/releases/net/java/dev/jna/jna/4.2.2/jna-4.2.2.jar
--
Mark Rotteveel
[Firebird-Java] wrote:
> Hello-Note that this error will be logged for each library that can't be
> I'd like to try to use jaybird 3 with the latest version of
> firebird. Specifically, I'd like to use the embedded database option on
> Windows. I have tried the following but I keep getting a
> java.lang.UnsatisfiedLinkError: Unable to load library 'fbembed'
found; even if for example fbclient will get loaded. I will change the
logging in beta 2 to log this only on debug, and only log on error if
none of the libraries could be loaded.
>You don't need to call newInstance(), and since Jaybird 2.2 you almost
> java.sql.Driver driver = (java.sql.Driver)
> Class.forName("org.firebirdsql.jdbc.FBDriver").newInstance();
never need to load the driver explicitly. A notable exception are web
applications if the driver is deployed with the application instead of
in the server itself.
> &nb sp; java.util.Properties props = new java.util.Properties();In Firebird 3, Embedded uses fbclient.dll, which then loads engine12 if
> props.put("charSet", "utf-8");
> driver.connect("jdbc:firebirdsql:embedded:" + path, props);
>
> From what I've read, the fbembed.dll was replaced by engine12. I took a
> quick peak at the jaybird code on github and there's a note about
> engine12 but the code is still trying to load fbembed:
> https://github.com/FirebirdSQL/jaybird/blob/master/src/jna-client/org/firebirdsql/gds/ng/jna/FbEmbeddedDatabaseFactory.java#L67
>
> What's the best way to proceed? Rename engine12 to fbembed? Update the
> code to try to load engine12?
it is necessary (and maybe a number of other libraries). The simplest
way to use embedded is to use the Firebird 3 zip kit, unzip it in a
folder, and specify the jna.library.path system property to point to
that folder.
So for example if I have unzipped Firebird 3 to D:\Firebird3\
Then use
java -Djna.library.path=D:\Firebird3\ -cp
.;jaybird-full-3.0.0-beta-1.jar;jna-4.2.2.jar YourMainClass
Just make sure the Firebird 3 you use has the same bitness as your java.exe
I just noticed that jna-4.2.2.jar is not included in the distribution
zip, you can download it from
https://maven.java.net/content/repositories/releases/net/java/dev/jna/jna/4.2.2/jna-4.2.2.jar
--
Mark Rotteveel