473,289 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Java Stored procedures cannot get updated class file recognised

Hi all,

Just been dabbling with java stored procedures and I'm having
problems replacing

System: db2 8.1.4 on RH 7.1 linux system

1). Look at java jdbc samples as supplied with db2 and run the
SpServer and Spclient progs against the default database SAMPLE. And
everything works.

2). Copy SpServer.java to SpDevinfo.java and write code to update a
field in one of my databases
3). update the spcat and SpCreate.db2,SpDrop.db2 as applicaable to my
code
4). Rewrite SpClient.java as appropriate to use my sp
5). Compile SpDevinfo.java and copy class file to
~db2inst1/sqllib/function
6). Run spcat to delete stored procedure and recreate it - get error
coz sp didn't exist 1st time but it adds the sp
7). Go into GUI control centre and check that the SP is visible - it
is
8). Run modifed SpClient to update my database.
9). Get error message returned from sp because I screwed up some of
the code.
10). Alter code, recompile SpDevinfo.java and overwrite class file in
~db2inst1/sqllib/function
11). Run spcat to drop and create new sp
12). Run Spclient - and get exactly same message as before BUT I've
replaced the error string originially returned with a different one.

It looks like whatever I do, I'm still running the class file from the
1st incarnation of the stored procedure and not the new one I wrote.

Any idea why I'm always getting the original class file?

Just to test,

a) remove SpDevinfo.class from ~db2inst1/sqllib/function
b). Run spcat to delete and recreate stored procedure - it works
c). Run Spclient - and it finds the sp and returnes the same error
message.

Looks like the class is somewhere else - or cached somewhere

Any help appreciated.
Alex
Nov 12 '05 #1
1 2371
It seems likely that you have KEEPDARI set to YES. KEEPDARI is a database
manager setting that causes cacheing of stored procedures and UDFs; the
effect of KEEPDARI is that DB2 often fails to see the newest version(s) of
stored procs. Having KEEPDARI set to YES on a production machine where
updates to the proc are infrequent makes sense for performance reasons but
most people will prefer setting KEEPDARI to NO on development machines.

If your machine is indeed a development machine, I'd suggest executing the
following commands in this exact order, then stopping and starting DB2, and
trying your stored procedure again:
db2 update dbm cfg using keepdari no

db2 terminate

db2 force application all

db2stop

db2start

If that doesn't help, post again and I can suggest less likely sources for
your problem.

Rhino

"Alex" <A.******@hull.ac.uk> wrote in message
news:b2**************************@posting.google.c om...
Hi all,

Just been dabbling with java stored procedures and I'm having
problems replacing

System: db2 8.1.4 on RH 7.1 linux system

1). Look at java jdbc samples as supplied with db2 and run the
SpServer and Spclient progs against the default database SAMPLE. And
everything works.

2). Copy SpServer.java to SpDevinfo.java and write code to update a
field in one of my databases
3). update the spcat and SpCreate.db2,SpDrop.db2 as applicaable to my
code
4). Rewrite SpClient.java as appropriate to use my sp
5). Compile SpDevinfo.java and copy class file to
~db2inst1/sqllib/function
6). Run spcat to delete stored procedure and recreate it - get error
coz sp didn't exist 1st time but it adds the sp
7). Go into GUI control centre and check that the SP is visible - it
is
8). Run modifed SpClient to update my database.
9). Get error message returned from sp because I screwed up some of
the code.
10). Alter code, recompile SpDevinfo.java and overwrite class file in
~db2inst1/sqllib/function
11). Run spcat to drop and create new sp
12). Run Spclient - and get exactly same message as before BUT I've
replaced the error string originially returned with a different one.

It looks like whatever I do, I'm still running the class file from the
1st incarnation of the stored procedure and not the new one I wrote.

Any idea why I'm always getting the original class file?

Just to test,

a) remove SpDevinfo.class from ~db2inst1/sqllib/function
b). Run spcat to delete and recreate stored procedure - it works
c). Run Spclient - and it finds the sp and returnes the same error
message.

Looks like the class is somewhere else - or cached somewhere

Any help appreciated.
Alex

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Suresh Tri | last post by:
Hi all, I am in search of any Enterprise level Opensource Project that uses Java Stored Procedures supported by Oracle. I could not find any by googling. Can any one plese point me to any such...
1
by: Rhino | last post by:
I am trying to get a sense of requirements and best practices for Java stored procedures in DB2 V7.2 for Windows. 1. Is it required or recommended that any of the following be closed before...
3
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default"...
0
by: Rhino | last post by:
I've written several Java stored procedures now (DB2 V7.2) and I'd like to write down a few "best practices" for reference so that I will have them handy for future development. Would the...
0
by: Sumit Gupta | last post by:
We are developing Java Stored Procedures using DB2 Development Center v8. While importing a stored procedure (.java file) from one database to another using the Development Center, all the...
0
by: Sumit Gupta | last post by:
We are developing Java Stored Procedures using JDBC on DB2 8.1 running on AIX 5.1. When we try to generate an access plan for any Java Stored Procedure from the Control Center, we get this...
1
by: Uma | last post by:
I tried to compile Java stored procedures and I am getting this message .. SQL1131N DARI (Stored Procedure) process has been terminated abnormally. SQLSTATE=38503 I am using DB2 UDB...
2
by: Rafael Faria | last post by:
Hi All, We are starting a large data warehousing project using DB2 8.2 on AIX. There is a direction to move any new internal development to Java and a question was raised: Would it be a good...
0
by: alexs | last post by:
Hi, I've been using the db2 developer workbench to produce some java stored procedures. The ones I'm working on now use some dom4j objects internally, so i need to ensure that the dom4j jar...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.