Home Documentation Development About the Database
About the Database PDF Print E-mail
Written by John Finlay   
Friday, 08 August 2008 13:33

About the Database

GedLynk uses an embedded HSQL database.  The first time the program runs it will check to see if a database exists and if it doesn't it will automatically create one. The database files will be created in the "data" directory.

The database will contain the GEDCOM data from any imported GEDCOM files.  It will also contain any information about any data sources that have been created.

Currently all of the data in the database is GEDCOM compatible, so if you export a GEDCOM file all of your data source information will be exported with it.  This means that you can share data and data source information with other GedLynk users.

Dropping the Database

Sometimes you will want to start with a fresh database.  The simplest way to do this is to:

  1. Stop GedLynk
  2. Erase all of the files inside the "data" directory
  3. Restart GedLynk and the database will be recreated

Using an Alternate Database

GedLynk uses the Java Persistence API to handle all of its database connectivity.  This API allows you to easily switch the database you are using.  So if for example you would like to use a MySQL database instead of the built-in HSQL database you can easily make this switch by:

  1. Obtain the JDBC driver for your chosen database
  2. Edit the JDBC properties in the META-INF/persistence.xml file.  The properties you will need to change are:
    1. <property name="toplink.jdbc.driver" value="org.hsqldb.jdbcDriver" />
    2. <property name="toplink.target-database" value="HSQL" />
    3. <property name="toplink.jdbc.user" value="sa" />
    4. <property name="toplink.jdbc.password" value=""/>
    5. <property name="toplink.jdbc.url" value="jdbc:hsqldb:data/gedlynk" />
  3. Run GedLynk
    1. Make sure that the JDBC driver for your database is on the classpath
    2. The database tables will be created automatically, so you will need to make sure that database user you supplied has create privileges.