473,608 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,Sp Drop.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 2390
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.goo gle.com...
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,Sp Drop.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
3273
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 projects? Actually i'm intereseted in knowing to what extent java stored procedures are used in enterprise applications. A opensource project will let me look into the code to get better idea.
1
2335
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 leaving the stored procedure: open Statement and PreparedStatement objects; open ResultSet objects; open JDBC connections? Although the stored procedure will still run succesfully if these open objects and connections are not closed, are there any...
3
2795
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" when I launched the IBM Distributed Debugger via D:\IBMDebug>idebug.exe -qdaemon -quiport=8000,8001 First, a bit of background. I am running DB2 V7.2 with Fixpack 9 applied on Windows XP Professional (all critical service applied). I've written...
0
4268
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 experts here agree with the following? Would they add any other points? 1. If the shop standard calls for logging of application errors, a stored procedure should log any error that it encounters immediately upon detecting it and then return to the...
0
1390
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 java.lang.String type parameters defined inside the java file get converted to Character(32) type. Is there a way that we can specify that these should be converted to Varchar2(40) instead? Since we import Java Stored Procedures from one DB to another...
0
1158
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 error: "An access plan cannot be created because the statement you used is not in the correct format or is not a query. Explanation:
1
1465
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 8.1.6 . When I tried to compile first time , I am having no problems.but this is happening all of a sudden.
2
1898
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 idea to have all stored procedures that we might need (ETL, additional transformers, etc) for this project and any other project written in Java as opposed to SQL/P? Does anyone have any number or experience in terms of performance differences?
0
1299
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 file is available. Within the developer workbench project I've added the appropriate dom4j jar file and everything builds just fine. When i try and deploy the
0
8063
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8496
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8148
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6816
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5475
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4024
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1594
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.