W
W
Wan-Derer2021-09-28 12:03:27
Hibernate
Wan-Derer, 2021-09-28 12:03:27

How can Hibernate specify a relative path to a db file?

There is a line in the hibernate.cfg.xml file :

<property name="hibernate.connection.url">
    jdbc:firebirdsql://localhost:3050/W:/Work/project/database/BASE.FDB
</property>

That's how it works. But I want to specify not an absolute, but a relative path to the database file.
The project structure is:
project
|- config
| | -hibernate.cfg.xml
|- database
| | - BASE.FDB

Tried all sorts of type options
jdbc:firebirdsql://localhost:3050/./../database/BASE.FDB

but doesn't want to.
Is it possible to set a relative path for Hibernate? And if so, how?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question