10.07.2015 Views

JDBC Developer's Guide - Supra - Cincom

JDBC Developer's Guide - Supra - Cincom

JDBC Developer's Guide - Supra - Cincom

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Relating Java classes to database class namesThe type map relates a Java class to a <strong>Cincom</strong> ORDB class name, which is aone-to-one mapping. This one-to-one mapping is stored in a hash table as akey-value pair. When you request custom mapping to be performed on a<strong>Cincom</strong> ORDB object reference, the <strong>JDBC</strong> driver considers the type map todetermine which Java class to use to materialize the data from the databaseobject. Once the object data is materialized as a Java object, you can updatethe attributes in the Java object. The changes can then be persisted in thedatabase by invoking the writeSQL() method of the java object. The driverhandles the actual conversion between SQL and Java.The Java application programmer is responsible for providing a type map classthat implements java.util.Dictionary. For example,java.util.Hashtable implements Dictionary.The type map class must implement a put() method used to enter eachmapping entry that relates a Java class to a database class name. The put()method must be implemented to accept a keyword-value pair, where thekeyword is an database class name and the value is the Java class object.Each connection object has an attribute for an associated type map object.<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 48Chapter: 4. <strong>Cincom</strong> ORDB ExtensionsSection: Creating custom Java classes for <strong>Cincom</strong> ORDB objects

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!