4.3. Database Support

4.3.1. MySQLDictionary parameters
4.3.2. OracleDictionary parameters

Kodo JDO can take advantage of any JDBC 1.x compliant driver, making almost any major database a candidate for use. See our officially supported database list for more information. Typically, Kodo JDO auto-configures its JDBC behavior and SQL for your database, based on the values of your connection-related JDO configuration properties.

If Kodo JDO cannot detect what type of database you are using, or if you are using an unsupported database, you will have to tell Kodo JDO what kodo.jdbc.sql.DBDictionary to use. The DBDictionary abstracts away the differences between databases. You can plug a dictionary into Kodo JDO using the kodo.jdbc.DBDictionary configuration property. The built-in dictionaries are listed below. If you are using an unsupported database, you may have to write your own DBDictionary subclass, a simple process.

The standard dictionaries all recognize the following properties. These properties will usually not need to be overridden, since the dictionary implementation should use the appropriate default values for your database. Typically these properties will only be changed when designing your own DBDictionary for an unsupported database.

4.3.1. MySQLDictionary parameters

The mysql dictionary also understands the following properties:

  • DriverDeserializesBlobs: Many MySQL drivers automatically deserialize BLOBs on calls to ResultSet.getObject. The MySQLDictionary overrides the standard DBDictionary.getBlobObject method to take this into account. If your driver does not deserialize automatically, set this property to false.

  • TableType: The MySQL table type to use when creating tables. Defaults to innodb.

  • UseClobs: Some older versions of MySQL do not handle clobs correctly. To enable clob functionality, set this to true. Defaults to false.

4.3.2. OracleDictionary parameters

The oracle dictionary understands the following properties:

  • UseTriggersForAutoIncrement: If true, then Kodo will allow simulation of auto-increment columns by the use of Oracle triggers. Kodo will assume that the current sequence value from the sequence specified in the AutoIncrementSequenceName parameter will hold the value of the new primary key for rows that have been inserted. For more details on auto-increment support, see Section 5.2.4.2, “Auto-Increment”.

  • AutoIncrementSequenceName: The global name of the sequence that Kodo will assume to hold the value of primary key value for rows that use auto-increment. If left unset, Kodo will use a the sequence named "SEQ_<table name>".

  • MaxEmbeddedBlobSize: Oracle is unable to persist Blobs using the embedded update method when Blobs get over a certain size. The size depends on database configuration, e.g. encoding. This property defines the maximum size Blob to persist with the embedded method. Defaults to 4000 bytes.

  • MaxEmbeddedClobSize: Oracle is unable to persist Clobs using the embedded update method when Clobs get over a certain size. The size depends on database configuration, e.g. encoding. This property defines the maximum size Clob to persist with the embedded method. Defaults to 4000 characters.