No result set being returned ....
From: Raquel (raquel_at_nospam.com)
Date: 06/25/04
- Next message: Raquel: "Re: No result set being returned ...."
- Previous message: Luke McCarthy: "Re: JDBC + SSL = "No trusted certificate found""
- Next in thread: Raquel: "Re: No result set being returned ...."
- Reply: Raquel: "Re: No result set being returned ...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 25 Jun 2004 03:37:33 -0400
This is a very simple DB2 SQLJ stored procedure. The problem is that it
seems to run fine but returns NOTHING. I mean..as if nothing has
happened..not resultset is returned. I am passing value 'D11' to :workdept
and I have checked in the table that 6 rows should have returned. Any
ideas why no resultset is being returned.
import java.sql.*;
import sqlj.runtime.*;
import sqlj.runtime.ref.*;
import java.io.*; // Input/Output classes
#sql iterator Sproc3_Iterator(String lname,String fname);
#sql context SpContext;
public class sproc3
{
public static void sproc3mtd ( String workdept,
ResultSet[] rs1 ) throws Exception
{
char error = 'n';
SpContext ctx = new SpContext( "jdbc:default:connection", false
);
Sproc3_Iterator sproc3_iterator = null;
// Get connection to the database
try
{
Connection con =
DriverManager.getConnection("jdbc:default:connection");
#sql [ctx] sproc3_iterator = {SELECT FIRSTNME, LASTNAME FROM
db2admin.EMPLOYEE WHERE WORKDEPT = :workdept};
rs1[0] = sproc3_iterator.getResultSet();
ctx.close();
} catch (SQLException sqlexcp)
{
sqlexcp.getMessage();
error = 'y';
}
}
}
The stored procedure definition is:
CREATE PROCEDURE SP3 (IN in1 CHAR(6))
LANGUAGE JAVA
PARAMETER STYLE JAVA
DYNAMIC RESULT SETS 1
FENCED THREADSAFE
EXTERNAL NAME
'sproc3.sproc3mtd';
TIA
Raquel.
- Next message: Raquel: "Re: No result set being returned ...."
- Previous message: Luke McCarthy: "Re: JDBC + SSL = "No trusted certificate found""
- Next in thread: Raquel: "Re: No result set being returned ...."
- Reply: Raquel: "Re: No result set being returned ...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]