Powered by SmartDoc

The jdbc.profile option

A jdbc.profile option specifies a configuration for data access.

Parameters

The jdbc.profile option takes one of the following values, or a configuration file name, as a parameter.

sql92
profile for standard SQL-92 databases.
postgresql
profile for PostgreSQL.
mysql
profile for MySQL.

Default configuration is sql92.

Artifact

The jdbc.profile option generates no additional classes. The jdbc.profile option just modified the behavior of Relaxer table objects.

The jdbc.profile option adds no additional methods to Relaxer objects.

Example

List 12.6.3.1[jdbcProfile.rng] is a sample schema for the jdbc.profile option.

jdbcProfile.rng
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <ref name="account"/>
  </start>
  <define name="account">
    <element name="account">
      <attribute name="accountNo">
        <data type="token"/>
      </attribute>
      <element name="balance">
        <data type="int"/>
      </element>
      <element name="owner">
        <data type="token"/>
      </element>
      <ref name="address"/>
      <zeroOrMore>
        <ref name="phone"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="address">
    <element name="address">
      <attribute name="zip">
        <data type="token"/>
      </attribute>
      <text/>
    </element>
  </define>
  <define name="phone">
    <element name="phone">
      <attribute name="area">
        <data type="token"/>
      </attribute>
      <data type="token"/>
    </element>
  </define>
</grammar>

Execution of Relaxer with the jdbc.config option is as follows:

$ relaxer -jdbc -jdbc.profile:mysql jdbcProfile.rng

List 12.6.3.2[account.ddl] is the DDL generated by this command.

account.ddl
CREATE TABLE `account` (
	`accountNo` VARCHAR(32) NOT NULL,
	`balance` INTEGER NOT NULL,
	`owner` VARCHAR(32) NOT NULL,
	`address` TEXT NOT NULL,
	`address_zip` VARCHAR(32) NOT NULL,
	`phone` TEXT
)

The DDL is tuned for MySQL and handles the following issues: