Using MySQL as the database manager

By default, TradeTrax stores it's data in a HSQLDB database, which is sufficient for personal use. Under rare circumstances (e.g. if ledger data should be shared between applications), it may be desirable to use MySQL instead.

The choice which DBM to use must be made before entering data into a ledger. There is no support for converting existing databases, save doing a full im-/export using external tools.

To setup MySQL, create a file called hibernate.xml in the ledger's data directory with the following content:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration SYSTEM 
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
   <session-factory>
   <property name="hibernate.dialect">
      org.hibernate.dialect.MySQLDialect
   </property>
   <property name="hibernate.connection.driver_class">
      com.mysql.jdbc.Driver
   </property>

   <!-- Assume tradetracker is the database name -->
   <property name="hibernate.connection.url">
      jdbc:mysql://localhost/tradetracker
   </property>
   <property name="hibernate.connection.username">
      tradetracker
   </property>
   <property name="hibernate.connection.password">
      tradetracker
   </property>
   <property name="hibernate.hbm2ddl.auto">
     update
   </property>


</session-factory>
</hibernate-configuration>

Adjust connection URL, username and password as appropriate.