Database absolute filepath


Is there a line of code that can be used to print out my databases absolute path?

I have set it as follows:

EntityManagerFactory emf = Persistence.createEntityManagerFactory("$objectdb/database/people.odb");

However, the data being shown in \lib\objectdb\database\people.odb is different than what is being used in the rest of the application so I think there might be more than one database somehow.


ObjectDB 2.5.7 adds the ability to retrieve connection details.

Please try the following test program (with version 2.5.7):

import javax.persistence.*;

public final class T1523
    public static void main(String[] args) {

        EntityManagerFactory emf =

        EntityManager em = emf.createEntityManager();

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Why did you call it test.tmp instead of test.odb?

What does the keyword drop at the end of the line do?


The drop parameter indicates a request to discard an old database (if exists) and create a new empty database. By default it works only for database files with the temp / tmp file name extensions.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login