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.

display the size and contents of the collectionSystem.out.println("Size before remove nulls: " +newActivities.getSize());ResultSet rs=newActivities.getResultSet();while (rs.next())System.out.println("Collection element " + rs.getInt(1) +" value: " + rs.getString(2));rs.close();// Use removeNulls method to delete "holes", then// display contents (using Array instead of// resultSet this time just for example)newActivities.removeNulls();System.out.println("Size after remove nulls: " +newActivities.getSize());Object [] vals = (Object [])newActivities.getArray();int elem = 0;for (elem = 0; elem < vals.length; elem++)System.out.println("Array element " + elem + " value: " +(String)vals[elem]);// Delete the first element and display size & contentsnewActivities.deleteValue(1);System.out.println("Size after delete element: " +newActivities.getSize());rs = newActivities.getResultSet();while (rs.next())System.out.println("Collection element " + rs.getInt(1) +" value: " + rs.getString(2));rs.close();<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 71Chapter: 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!