ethnarch
asked on
Hibernate XML Configuration file and application path
I am using firebird's embedded database(or trying to atleast) with my application. I want to be able to set the path to the database relative to my application for instance normally outside of hibernate i could do something like this:
String dir = System.getProperty("user.d ir");
Connection con = null;
Driver d = (Driver)Class.forName( "org.firebirdsql.jdbc.FBDr iver" ).newInstance();
con = DriverManager.getConnectio n("jdbc:fi rebirdsql: embedded:" +dir + "\\USERDB.FDB", "sysdba", "masterkey");
I can't figure out how i would get hibernate to recognize the working directory of the application in it's xml configuration file I would like to do something similar to below where %ApplicationDIR% would be the application directory. Is this possible?
<property name="hibernate.connection .url">jdbc :firebirds ql:embedde d:%Applica tionDIR%US ERDB.FDB</ property>
String dir = System.getProperty("user.d
Connection con = null;
Driver d = (Driver)Class.forName( "org.firebirdsql.jdbc.FBDr
con = DriverManager.getConnectio
I can't figure out how i would get hibernate to recognize the working directory of the application in it's xml configuration file I would like to do something similar to below where %ApplicationDIR% would be the application directory. Is this possible?
<property name="hibernate.connection
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
<property name="hibernate.connection
I will try your idea later Ajay and i'll just give you both points for helping thanks anyway though.