131 words

Is there an API to get the current version of ObjectDB that's being used?

#1
2017-06-01 11:54

Is there an API to get the current version of ObjectDB that's being used? This would be very handy to have, because it is somewhat difficult to know what version of the ObjectDB you are currently using since the objectdb.jar filename remains the same for all versions (which is not a bad thing by itself).

Shridhar Bharthulwar
shridharb
shridharb's picture
Joined on 2015-08-07
User Post #1
#2
2017-06-01 12:07

It is not JPA portable, but you should be able to get the version with the following code:

public static void main(String[] args)
{
    com.objectdb.jdo.PMF pmf = new com.objectdb.jdo.PMF();
    String version = pmf.getProperties().getProperty("VersionNumber");
    pmf.close();
 
    System.out.println(version);
}
ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,760
#3
2017-06-01 14:56

I tried it, and this works...thank you very much for the prompt response!

Shridhar Bharthulwar
shridharb
shridharb's picture
Joined on 2015-08-07
User Post #2

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel