473,385 Members | 1,588 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,385 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 2377
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.