Dashboard > PXE > Reference > Databases > View

Page Operations


Navigation


PXE Log In   View a printable version of the current page.
Databases
Added by Maciej Szefler, last edited by Maciej Szefler on Jul 26, 2005

The standard distribution of PXE relies on a Hibernate data access layer to provide persistence facilities. Hibernate can support most major databases; consequently, PXE can in theory support most major databases.

By default, the PXE distribution uses an embedded HypersonicSQL instance to provide persistence facilities. In order to use a different database, one must generally:

  • install the database
  • populate the database with PXE's schema (schema files are found in etc/*.sql of the PXE distribution)
  • install the database's JDBC driver in PXE's lib/ directory
  • modify the hibernate.properties and pxe-config.xml files in the etc/ directory of the PXE distribution

HypersonicSQL

HypersonicSQL (HSQL) is included with the PXE distribution and is the default database used by the PXE stand-alone server. To use this database, simply leave the configuration files as is. More precisely, etc/hibernate.properties and etc/pxe-config.xml should look like:

/etc/hibernate.properties
hibernate.dialect=net.sf.hibernate.dialect.HSQLDialect
/etc/pxe-config.xml
.
  .
  .
  <kmodule name="fivesight.pxe:mod=PxeDB" class="ModJdbcDS">
    <attribute name="dataSourceName">pxe-ds</attribute>
    <attribute name="transactionManagerName">TransactionManager</attribute>
    <attribute name="driver">org.hsqldb.jdbcDriver</attribute>
    <attribute name="username">sa</attribute>
    <attribute name="password"></attribute>
    <attribute name="url">jdbc:hsqldb:<pxe-home/>/hsql/pxeDb</attribute>
    <attribute name="poolMax">1</attribute>
    <attribute name="poolMin">1</attribute>
  </kmodule>
  .
  .
  .

Note that with HypersonicSQL it is important to set the poolMax property to 1 in order to avoid database collisions: HypersonicSQL does not support transaction isolation!

MySQL

In order to use MySQL with PXE, one must follow the following steps:

  1. install / locate a MySQL (v4.0 or v4.1) server installation
  2. configure said MySQL server to accept TCP connections (NOTE: this is not the default for MySQL!)
  3. create / designate a user (pxe-user) on the MySQL server for use by PXE
  4. create a database (pxe-db) for PXE's use on the MySQL server
  5. populate the pxe-db with the PXE schema (found in etc/mysql.sql in the PXE distribution)
  6. grant the pxe-user read/write access to the pxe-db
  7. obtain the MySQL J-Connect JDBC driver (v3.x) and copy it to PXE's lib/ directory
  8. Modify PXE's etc/hibernate.properties file to resemble:
    /etc/hibernate.properties
    hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
  9. Modify PXE's etc/pxe-config.xml file to resemble:
    /etc/pxe-config.xml
    .
      .
      .
      <kmodule name="fivesight.pxe:mod=PxeDB" class="ModJdbcDS">   
        <attribute name="dataSourceName">pxe-ds</attribute>
        <attribute name="transactionManagerName">TransactionManager</attribute>
        <attribute name="driver">com.mysql.jdbc.Driver</attribute>
        <attribute name="url">jdbc:mysql://localhost/pxe-db</attribute>
        <attribute name="username">pxe-user</attribute>
        <attribute name="password"></attribute>
        <attribute name="poolMax">10</attribute>
        <attribute name="poolMin">5</attribute>
      </kmodule>
      .
      .
      .


Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 1.4.1 Build:#212 Jun 02, 2005) - Bug/feature request - Contact Administrators