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.

Retrieving a subset of an array’s elementsTo retrieve a subset of the array, you can pass in an index and a count toindicate where in the array you want to start and how many elements you wantto retrieve. For example:Object object = arr.getArray(index, count);And using getResultSet():ResultSet rset= arr.getResultSet(index, count);The following example shows various uses of methods getArray() andgetResultSet().This sample code may be found in the%ORDB%\demo\jdbc\samples\collectionSample1.java file://////// This sample demonstrates the use of the java.sql.Array interface with// <strong>Cincom</strong> ORDB database collections.//package demo.jdbc.samples;import java.sql.*;import java.math.*;import java.io.*;import ordbjava.jdbc.*;import java.util.HashMap;//import for custom mappingclass collectionSample1 {public static void main (String args []) throws SQLException{// Connect to the demodb database without autocommit enabled.Connection conn = demodbHelper.makeConnection (false);Statement stmt = conn.createStatement ();ResultSet rset = stmt.executeQuery ("SELECT name, activities FROMresort");<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 63Chapter: 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!