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.

Clean up <strong>Cincom</strong> ORDB workspace used by collectionif (intSet != null)intSet.free();stmt.close();conn.close();}}Creating and modifying collectionsThe ordbCollection class provides methods that allow you to create andmaintain your database collections. The methods modify a copy of thecollection within the workspace. After creating and/or updating a collectionwith these methods, you have to update the database attribute with themodified collection. This can be done with SQL using thejava.sql.PreparedStatement, or by using the setAttributeValue() method ofordbObject.The methods of the ordbCollection class are:♦♦♦♦ordbCollection(Connection con)deleteValue(int index)insertValue(Object javaObj, int <strong>JDBC</strong>type, int index)removeNulls()ordbCollection(Connection con)The ordbCollection(Connection con) constructor creates an empty collection.Instances of ordbCollection created with this constructor are heterogeneousand can accept any type of element data. The database performs Typevalidation when the new collection is associated with the database attribute.deleteValue(int index)The deleteValue(int index) method removes the collection element at theindex position. All elements to the right of the index will be shifted oneposition to the left.Be careful when using loops! The size of the collection will decrease by 1.<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 69Chapter: 4. <strong>Cincom</strong> ORDB ExtensionsSection: Working with <strong>Cincom</strong> ORDB collections

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

Saved successfully!

Ooh no, something went wrong!