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.

prepare a statement that has an input parameterPreparedStatement pstmt = conn.prepareStatement("SELECT description FROM seashore WHERE " +"seashore.identity = ?");// Query the beaches of resortsStatement stmt = conn.createStatement ();ResultSet rset = stmt.executeQuery ("SELECT beach FROM resort");java.sql.Ref beach = null;while (rset.next ()) {// get the beach referencebeach = rset.getRef(1);// set the parameterpstmt.setRef(1, beach);// execute the prepared statementResultSet rset2 = pstmt.executeQuery();// fetch and display the result (should only be 1)rset2.next();String description = rset2.getString(1);System.out.println("description of beach (" + beach + "): " +description);// close the result setrset2.close();}// close statement and connectionstmt.close();pstmt.close();conn.close();}}<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 32Chapter: 4. <strong>Cincom</strong> ORDB ExtensionsSection: Working with <strong>Cincom</strong> ORDB objects and object references

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

Saved successfully!

Ooh no, something went wrong!