Question

I want to use linux at work but everytime a class gets added to persistence.xml I have to change it's javax.persistence.jdbc.url.

Is there a way to make hibernate use one property for windows and another one for linux without creating two files?

windows is like C:/blah/db.gdb and linux is /home/blah/db.gdb
how can we use one for all?

Was it helpful?

Solution

You can define an alias on the server in aliases.conf (databases.conf in Firebird 3 and higher), and then specify that alias in the connection url instead.

Say that the alias is myApplicationDb, then you can use the URL:

jdbc:firebirdsql://myserver/myApplicationDb

However this is less flexible because it requires you to maintain the aliases.conf file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top