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.

Invoking database methodsYou can use the invokeMethod and invokeClassMethod operations to callinstance and class methods on the database.Instance methods. When invoking instance methods, you must provide:♦The method name♦ An array of ordered arguments for the methodClass methods. When invoking class methods, you must provide:♦♦The database connection objectThe class name♦ The name of the method and an array of ordered arguments for the methodExample. The following example demonstrates calling both class and instancemethods on the location class of demodb. This sample code may be found inthe %ORDB%\demo\jdbc\samples\methodSample.java file://// This example demonstrates the use of ordbObject to invoke databasemethodspackage demo.jdbc.samples;import java.sql.*;import java.math.*;import java.io.*;import java.awt.*;import ordbjava.jdbc.*;class methodSample {public static void main (String args []) throws SQLException{// Connect to the demodb database without autocommit enabled.Connection conn = demodbHelper.makeConnection (false);// Find the location instance for "Holiday Inn" by making// use of the v5_find_lodging_named class method of location// Set up the argument for the database methodObject[] method_argv = new Object[1];method_argv[0] = "Holiday Inn";<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 36Chapter: 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!