Java Examples for ASE 12.5


Class Routines2

java.lang.Object
  |
  +--Routines2

public class Routines2
extends java.lang.Object

A class with a bestTwoEmpsmethod for an SQLJ create procedure that returns output parameter values.


Constructor Summary
Routines2()
           
 
Method Summary
static void bestTwoEmps(java.lang.String[] n1, java.lang.String[] id1, java.math.BigDecimal[] s1, int[] r1, java.lang.String[] n2, java.lang.String[] id2, java.math.BigDecimal[] s2, int[] r2, int regionParm)
          A method that provides the column data for the top two employees whose region is above a given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Routines2

public Routines2()
Method Detail

bestTwoEmps

public static void bestTwoEmps(java.lang.String[] n1,
                               java.lang.String[] id1,
                               java.math.BigDecimal[] s1,
                               int[] r1,
                               java.lang.String[] n2,
                               java.lang.String[] id2,
                               java.math.BigDecimal[] s2,
                               int[] r2,
                               int regionParm)
                        throws java.sql.SQLException
A method that provides the column data for the top two employees whose region is above a given value.

The method is intended for an SQLJ create procedure such as the following:

  create procedure best2
  	(out n1 varchar(50), out id1 varchar(5), out s1 decimal(6,2), out r1 integer, 
  	out n2 varchar(50), out id2 varchar(50), out r2 integer, out s2 decimal(6,2), 
  	in region integer)
  	language java parameter style java
  	external name 'Routines2.bestTwoEmps(java.lang.String[],
  		java.lang.String[], int[],
  		java.math.BigDecimal[], java.lang.String[],
  		java.lang.String[], int[],
  		java.math.BigDecimal[], int)'
  

That SQLJ procedure "best2" would be called in SQL as follows:

  declare @n1 varchar(50), @id1 varchar(5),
Parameters:
n1 - a string array for the first output name
id1 - a string array for the first output id
r1 - a string array for the first output region
s1 - a string array for the first output sales
n2 - a string array for the second output name
id2 - a string array for the second output id
r2 - a string array for the second output region
s2 - a string array for the second output sales
regionParm - an int for the given region

Java Examples for ASE 12.5