Embedded 2.5 Linux

10 views
Skip to first unread message

Hugo Larson

unread,
Jun 23, 2023, 2:34:23 AM6/23/23
to Firebird-java
Hello,

I wonder if there is an example on how to do an embedded connection to with Jaybird to FB 2.5 on Linux.

I have successfully done it on windows but it does not Work on Linux.

System.setProperty("jna.library.path", pathtoembedlibs);

I think these are necessary path/files on Linux.

Inline image

Thanks,
Hugo

Mark Rotteveel

unread,
Jun 23, 2023, 2:53:46 AM6/23/23
to firebi...@googlegroups.com
On 23-06-2023 08:34, 'Hugo Larson' via firebird-java wrote:
> I wonder if there is an example on how to do an embedded connection to
> with Jaybird to FB 2.5 on Linux.
>
> I have successfully done it on windows but it does not Work on Linux.

What exactly does "does not Work on Linux" mean? What error do you get?

> System.setProperty("jna.library.path", pathtoembedlibs);
>
> I think these are necessary path/files on Linux.
>
> Inline image

Pointing to the directory with those libs should work, though the layout
doesn't match the Firebird build you can download from the site. Which
distribution are you using?

However, I rarely use Linux, and I seem to recall that there are some
caveats on Linux, but I can't recall what they are. I'll make some time
to test things out.

Mark
--
Mark Rotteveel

Hugo Larson

unread,
Jun 23, 2023, 5:29:49 AM6/23/23
to firebi...@googlegroups.com
Hi Mark,

I use Ubuntu 22.

//Hugo



--
You received this message because you are subscribed to the Google Groups "firebird-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-jav...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/firebird-java/99f52b71-ef18-1b03-5977-50798dcce7b2%40lawinegevaar.nl.

Hugo Larson

unread,
Jun 23, 2023, 5:40:03 AM6/23/23
to firebi...@googlegroups.com
Hi, 

Ubuntu 22.

Attempting to set jna.library.path to: /home/ubuntu/FB25_EMB
 jdbc:firebirdsql:embedded:/home/ubuntu/FB25_EMB/employee.fdb

java.lang.UnsatisfiedLinkError: Unable to load library 'fbembed': Native library (linux-aarch64/libfbembed.so) not found in resource path (convert.jar:lib/jaybird-full-4.0.5.java8.jar:lib/jna-4.4.0.jar)
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:303)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
        at com.sun.jna.Library$Handler.<init>(Library.java:179)
        at com.sun.jna.Native.loadLibrary(Native.java:569)
        at com.sun.jna.Native.loadLibrary(Native.java:544)
        at org.firebirdsql.gds.ng.jna.FbEmbeddedDatabaseFactory.createClientLibrary(FbEmbeddedDatabaseFactory.java:69)




On Friday, June 23, 2023 at 08:53:49 AM GMT+2, Mark Rotteveel <ma...@lawinegevaar.nl> wrote:



--
You received this message because you are subscribed to the Google Groups "firebird-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-jav...@googlegroups.com.

Mark Rotteveel

unread,
Jun 23, 2023, 6:08:08 AM6/23/23
to firebi...@googlegroups.com
On 23-06-2023 11:39, 'Hugo Larson' via firebird-java wrote:
> Ubuntu 22.
>
> Attempting to set jna.library.path to: /home/ubuntu/FB25_EMB
>  jdbc:firebirdsql:embedded:/home/ubuntu/FB25_EMB/employee.fdb
>
> java.lang.UnsatisfiedLinkError: Unable to load library 'fbembed': Native
> library (linux-aarch64/libfbembed.so) not found in resource path
> (convert.jar:lib/jaybird-full-4.0.5.java8.jar:lib/jna-4.4.0.jar)
>         at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:303)
>         at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
>         at com.sun.jna.Library$Handler.<init>(Library.java:179)
>         at com.sun.jna.Native.loadLibrary(Native.java:569)
>         at com.sun.jna.Native.loadLibrary(Native.java:544)
>         at
> org.firebirdsql.gds.ng.jna.FbEmbeddedDatabaseFactory.createClientLibrary(FbEmbeddedDatabaseFactory.java:69)
Which Firebird distribution are you using? The Firebird 2.5 builds
released by the project do not provide an aarch64 build. The error you
get would also happen if you tried it with the amd64 (a.k.a x86-64 or
x64) binaries on an aarch64 platform: it would first search the library
path, but it can't load amd64 binaries, so then it looks on the
classpath for linux-aarch64/libfbembed.so.

Also try adding system property -Djna.debug_load=true to get debug
output from loading the libraries.

Mark
--
Mark Rotteveel

Hugo Larson

unread,
Jun 23, 2023, 7:06:54 AM6/23/23
to firebi...@googlegroups.com
Hi Mark,

The computer I was testing on was indeed aarch64.
Tested on another amd64 and it loaded libraries!

sorry for taking your time regarding this.

But now it complains about password :(

Exception in thread "main" java.sql.SQLInvalidAuthorizationSpecException: Your user name and password are not defined. Ask your database administrator to set up a Firebird login. [SQLState:28000, ISC error code:335544472]

I read that embedded should take any credentials.


try (Connection con = DriverManager.getConnection(url, "sysdba", "masterkey")) {
     try (Statement stmt = con.createStatement(); 
    ResultSet rs = stmt.executeQuery("SELECT * FROM RDB$DATABASE");) {
    while (rs.next()) {
      System.out.println(rs.getString(2));
   }
  }
}



Mark
--
Mark Rotteveel

--
You received this message because you are subscribed to the Google Groups "firebird-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-jav...@googlegroups.com.

Mark Rotteveel

unread,
Jun 23, 2023, 7:23:21 AM6/23/23
to firebi...@googlegroups.com
On 23-06-2023 13:06, 'Hugo Larson' via firebird-java wrote:
> Hi Mark,
>
> The computer I was testing on was indeed aarch64.
> Tested on another amd64 and it loaded libraries!
>
> sorry for taking your time regarding this.
>
> But now it complains about password :(
>
> Exception in thread "main"
> java.sql.SQLInvalidAuthorizationSpecException: Your user name and
> password are not defined. Ask your database administrator to set up a
> Firebird login. [SQLState:28000, ISC error code:335544472]
>
> I read that embedded should take any credentials.

For Firebird 2.5 and earlier, that is only true on Windows. For Firebird
2.5 and earlier on Linux, embedded also requires authentication using
the security database. This was changed with Firebird 3.0 to no longer
require authentication in embedded mode.

Mark
--
Mark Rotteveel

Hugo Larson

unread,
Jun 23, 2023, 7:38:55 AM6/23/23
to firebi...@googlegroups.com
Thanks Mark,

Have a nice weekend.



Mark
--
Mark Rotteveel

--
You received this message because you are subscribed to the Google Groups "firebird-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-jav...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages