Get Firebird Server Version Information

I am using java driver and jaybird. In my previous version with jaybird 2.x, I used GDS (Services API) low-level access to connect the server (without connection to the db part in the connection) to get the server version string.

Now I'm trying to use FB3 + jaybird3beta. There is no GDS API in JB3. As I can see from the docs, there is an org.firebirdsql.util.FirebirdSupportInfo object with 3 implementations

static FirebirdSupportInfo  supportInfoFor(Connection connection) 
static FirebirdSupportInfo  supportInfoFor(FbDatabase database) 
static FirebirdSupportInfo  supportInfoFor(GDSServerVersion serverVersion) 

As I can see:

  • GDSServerVersion - an object representing the version of the Firebird server (already received somehow).
  • FbDatabase - a handle to the database connection.
  • A connection is a kind of "connection." So dig a bucket:

there is also a java.sql.DriverManager with the getConnection () function, which "Attempts to establish a connection to the given database URL

So, as I understand it, can’t get the server version without connecting to any database? Or am I missing something?

Or how can I get the server version using only the server: port and username / password?

+4
source share
1 answer

Unlike the earlier version of this answer, this is already possible (I forgot about it). To get the server version, you can use the class org.firebirdsql.management.FBServiceManager:

FBServiceManager manager = new FBServiceManager();
manager.setHost("localhost");
manager.setUser("sysdba");
manager.setPassword("your password");
System.out.println(manager.getServerVersion());

ServiceManager, JDBC-484, Jaybird 3.0.0 final.

: org.firebirdsql.util.FirebirdSupportInfo Jaybird , , Firebird. , . , , , ODS ( ).

: Jaybird.

+2

Source: https://habr.com/ru/post/1672561/


All Articles