Oracle 8i Data Cartridge Developer's Guide
Release 2 (8.1.6)

Part Number A76937-01

Library

Product

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

Java Demo Script, 4 of 4


extdemo3a.java Demonstration Script

The extdemo3a.java script demonstrates the class that holds the ResultSet and 
PreparedStatement to be stored in CartridgeServices context.

The Java code


Class extdemo3a

This class is needed because the ResultSet and the PreparedStatement
must both have their context saved during calls between the Cartridge 
execution and the server.  The extdemo3a class can then be cast as an
Object and passed into the oracle.CartridgeServices.ContextManager
class to be stored away for the duration of the session.


import java.sql.SQLException;
import oracle.jdbc.driver.OracleConnection;
import oracle.jdbc.driver.OracleTypes;
import oracle.sql.CustomDatum;
import oracle.sql.CustomDatumFactory;
import oracle.sql.Datum;
import oracle.sql.STRUCT;
import oracle.jpub.runtime.MutableStruct;

import java.lang.*;
import java.sql.*;
import oracle.*;
import oracle.sql.*;
import oracle.jdbc.driver.*;
import sqlj.runtime.ref.DefaultContext;

public class extdemo3a 
{


Variables to hold the ResultSet and the PreparedStatement

  OracleResultSet rs;
  PreparedStatement stmt;


Constructor

  public extdemo3a(OracleResultSet r, PreparedStatement s)
  {
	rs=r;
	stmt=s;
  }

Accessor Methods

  public OracleResultSet getRs(){ return rs;}
  public PreparedStatement getStmt() {return stmt;}
  public void setRs(OracleResultSet r) {rs=r;}
  public void setStmt(PreparedStatement s) {stmt=s;}

}


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index