472,791 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 software developers and data experts.

DB2 database shutdowns after excecution of sqlj procedure

In my SQLJ procedure , there is call to another stored procedure using a callable statement. But during excecution when .excute() happens . . the DB2 V7 database shuts down.

Plz help.

Follwing is the code . .
************ CAL02RSCAL.sqlj which call another PL/SQL Strored procedure TESTRSFILEPL written in DB2 *******************


package PAKCAL02RSCAL ;
import java.sql.*;
import sqlj.runtime.*;
import sqlj.runtime.ref.*;
import java.math.*;
import java.io.*;
import java.text.*;
import java.util.Date;

#sql iterator Defined_iter2 (String CLIENTID, String GRANTNUMBER, String PPTUNIQUEID);

public class CAL02RSCAL
{

public static void cAL02RS (
String instrPPTUNIQUEID,
String instrCLIENTID,
ResultSet[] out_rs
) throws SQLException, Exception
{

try
{
Defined_iter2 iter2;
String strPPTUNIQUEID = "";
String strCLIENTID = "";
PrintWriter pwx = null;
strPPTUNIQUEID = instrPPTUNIQUEID;
strCLIENTID = instrCLIENTID;
pwx = new PrintWriter( new FileWriter("/sapphire/users/devuser/ajitk/UPLOAD_RS/PAKCAL02RSCAL.log"),true );
//Start
pwx.println("CAL02RS: SQLJ versionn");
pwx.flush();
Connection conn = null;
String url;
String procName = "";
CallableStatement callStmt;

conn=DriverManager.getConnection("jdbc:db2:DEV3DB; create=true","spsdev","sps2diff");
conn.setAutoCommit(false);
pwx.println("CAL02RS: Before call of TESTRSFILEPLllll");
pwx.flush();
String sql = "CALL SPSSTADM.TESTRSFILEPL (?,?)";
callStmt = conn.prepareCall(sql);
callStmt.setString (1, instrPPTUNIQUEID);
callStmt.setString (2, instrCLIENTID);
callStmt.execute();
out_rs[0] = callStmt.getResultSet();

pwx.println("CAL02RS: SQLJ version End");
pwx.flush();
} // try
catch (Exception e)
{
System.out.println("IN the Exception Block");
}
}
}
*********** Create Statement *******
CREATE PROCEDURE SPSDEV.CAL02RSCAL ( IN instrPPTUNIQUEID varchar(4000), IN instrCLIENTID varchar(4000) ) EXTERNAL NAME 'SPSDEV.PAKCAL02RSCAL:PAKCAL02RSCAL.CAL02RSCAL.cAL 02RS' RESULT SETS 1 LANGUAGE JAVA PARAMETER STYLE JAVA NOT DETERMINISTIC FENCED NO DBINFO NULL CALL MODIFIES SQL DATA;
call sqlj.refresh_classes(void);

******* code for TESTRSFILE ************
CREATE PROCEDURE TESTRSFILEPL ( IN instrPPTUNIQUEID varchar(4000), IN instrCLIENTID varchar(4000))
RESULT SETS 1
LANGUAGE SQL
------------------------------------------------------------------------
-- SQL Stored Procedure
------------------------------------------------------------------------
P1: BEGIN

DECLARE c3 CURSOR WITH RETURN FOR
select CLIENTID, GRANTNUMBER, PPTUNIQUEID
from grantmaster where
clientid = instrCLIENTID
and PPTUNIQUEID = instrPPTUNIQUEID;

OPEN c3;

END P1

@
***************************

Plzzz Help
Jul 17 '07 #1
0 1205

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Paul Reddin | last post by:
Hi, (V8.1 FP2) Trying to run SQLJ.INSTALL_JAR, we get the following error SQL1131N DARI (Stored Procedure) process has been terminated abnormally. SQLSTATE=38503 Not sure why this has...
0
by: Bernard Dhooghe | last post by:
DB2 UDB V8.1 Fixpak 4 AIX 5.1 CLASSPATH: /usr/opt/db2_08_01/java/db2jcc.jar:/usr/opt/db2_08_01/java/db2jcc_license_cu.jar:/usr/opt/db2_08_01/java/sqlj.zip:/usr/java131/jre/lib/rt.jar: Program:...
9
by: Janick | last post by:
With DB2 7.2 we used to call methods from other SQLJ Stored Procedures, as it was not possible to call SPs via the SQL Call-statement from within SPs. So we always had a method like this: ...
10
by: Raquel | last post by:
UDB PE 8.1 on Win XP. ok, this function caused a lot of grief today. My stored procedures are java stored procedures, all FENCED and directly placed in \sqllib\function directory (not built into...
2
by: Raquel | last post by:
UDB V8.1.3 on XP. While trying out SQLj procedures, I just 'compile' my stored procedure code (by command sqlj program-name.sqlj) and run it. That's it. So, how and when is db2profc and all the...
12
by: Rhino | last post by:
I am having an odd problem: the sqlj command on my system doesn't work. I am running DB2 (LUW) V8 (FP8) on WinXP. I haven't done an sqlj program since Version 6 of DB2 (LUW) so I checked the...
7
by: Jean-Marc Blaise | last post by:
Hi, The dev center calls sqlj.DB2_UPDATEJARINFO ('JMARC.JMB','JMB','file:JMB.sqlj') to update the sqlj routine source. I tried in CLP from the directory containing jar and sqlj files (Windows...
3
by: tol7481 | last post by:
Hi, I'm trying to deploy a Java stored procedure on DB2 V8 on a Linux box, but I have some problems. I've added to the classpath the following JARs sqllib/java/db2java.zip...
1
by: vasilip | last post by:
I'm trying to insert large polygon data via sql statement. since the data was over 32k I had to use sqlj to insert my data. I made a class that inserts the data. ran sqlj, generated the .java...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.