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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

♦writeSQL() method. You must implement writeSQL() as follows:public void writeSQL(SQLOutput stream) throws SQLException- writeSQL() must take as input an SQLOutput stream.- When your Java application calls writeSQL(), the <strong>JDBC</strong> driver creates anSQLOutput stream object and populates it with data from your customJava class. When the driver calls writeSQL(), it passes in this streamparameter.- For each Java datatype that maps to an attribute of the <strong>Cincom</strong> ORDBclass, writeSQL() must call the appropriate writeXXX() method of theSQLOutput stream that is passed in.- For example, if you are writing to objects that have a CHAR attributefollowed by an INTEGER attribute, then you must have a writeString()call and a writeInt() call in your writeSQL() method. These methodsmust be called according to the order that attributes appear in theschema definition of the <strong>Cincom</strong> ORDB class.- writeSQL() must then write the data converted by the writeXXX()methods to the SQLOutput stream so it can be written to the databaseonce you execute the prepared statement.<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 60Chapter: 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!