Subject | Re: [Firebird-Java] Get ODS version |
---|---|
Author | Mark Rotteveel |
Post date | 2014-08-15T10:38:26Z |
On 14 Aug 2014 23:24:52 -0700, "hugo.larson@... [Firebird-Java]"
<Firebird-Java@yahoogroups.com> wrote:
http://www.firebirdsql.org/file/documentation/drivers_documentation/java/2.2.5/docs/org/firebirdsql/jdbc/FirebirdDatabaseMetaData.html#getOdsMajorVersion--
http://www.firebirdsql.org/file/documentation/drivers_documentation/java/2.2.5/docs/org/firebirdsql/jdbc/FirebirdDatabaseMetaData.html#getOdsMinorVersion--
In code:
Connection connection = ....
FirebirdDatabaseMetaData dbmd =
connection.getMetaData().unwrap(FirebirdDatabaseMetaData.class);
// or: FirebirdDatabaseMetaData dbmd = (FirebirdDatabaseMetaData)
connection.getMetaData()
int odsMajor = dbmd.getOdsMajorVersion();
int odsMinor = dbmd.getOdsMinorVersion();
Mark
<Firebird-Java@yahoogroups.com> wrote:
> Hello,Is there a way to get the ODS version of the database filecurrently
> used?My problem is that we are migrating many databases at customersites
> from FB 1.5 to 2.5 and it happens that we forget to convert the databasewith
> file to 2.5.Its possible to connect to an old file with 2.5 engine but
> side some effects.I need detect if an old file is used.Thanks,HugoYou can obtain this from the database metadata:
http://www.firebirdsql.org/file/documentation/drivers_documentation/java/2.2.5/docs/org/firebirdsql/jdbc/FirebirdDatabaseMetaData.html#getOdsMajorVersion--
http://www.firebirdsql.org/file/documentation/drivers_documentation/java/2.2.5/docs/org/firebirdsql/jdbc/FirebirdDatabaseMetaData.html#getOdsMinorVersion--
In code:
Connection connection = ....
FirebirdDatabaseMetaData dbmd =
connection.getMetaData().unwrap(FirebirdDatabaseMetaData.class);
// or: FirebirdDatabaseMetaData dbmd = (FirebirdDatabaseMetaData)
connection.getMetaData()
int odsMajor = dbmd.getOdsMajorVersion();
int odsMinor = dbmd.getOdsMinorVersion();
Mark