Reputation: 3566
After few years of PHP
I decided to learn Java
, so I'm writing simple desktop app that uses Hibernate
and SQLite
.
I'd like to keep database outside of the .jar generated by mvn package
, so one can perform quick backup of the data just by copying one file. So far, my hibernate.cfg.xml
looks like this:
<hibernate-configuration>
<session-factory>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="dialect">org.hibernate.dialect.SQLiteDialect</property>
<property name="connection.driver_class">org.sqlite.JDBC</property>
<property name="connection.url">jdbc:sqlite:mydb.db</property>
<property name="connection.username"></property>
<property name="connection.password"></property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping class="com.ex3v.hibernate.Contact"/>
</session-factory>
</hibernate-configuration>
what connection.url
do I have to specify to make hibernate create db file next to .jar in working directory?
Upvotes: 0
Views: 9504