By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,018 Members | 930 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,018 IT Pros & Developers. It's quick & easy.

Regarding install_jar ... Urgent

P: n/a
Hi we have a certain SQL script. From that script we have calls like:
DROP FUNCTION A@
call sqlj.remove_jar( 'AXML')@
CALL SQLJ.REFRESH_CLASSES()@
call sqlj.install_jar( 'file:C:\AXML.jar', 'AXML' )@
CALL SQLJ.REFRESH_CLASSES()@
CREATE FUNCTION A(xml VARCHAR(3000),type VARCHAR(3000))
RETURNS VARCHAR(3000)
EXTERNAL NAME 'AXML:com.AConvertXML.convertXML'
LANGUAGE JAVA
PARAMETER STYLE DB2GENERAL
NOT DETERMINISTIC
FENCED
NO SQL
NO EXTERNAL ACTION
ALLOW PARALLEL
NO DBINFO@

However after running this script we notice that the old AXML jar
hasn't been removed and the newly changed AXML.jar is not being
installed so the changes are not taking effect.

The AXML.jar is kept in the C drive.
Do we need to keep the jar under SQLLIB\functions in the server?
What maybe the possible reasons for saj.install_jar not working?

May 2 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
If jar file needs to be in server. But you can give a diffrent path
provided you give that path in the create procedure command (which
you have done). I am not sure if remove_jar would delete the file from
the server .It just removes from database catalogs .Its better you
manually remove the file or overwrite the file "AXML.jar" and then
issue create procedure. As DB2 searches classpath and path given using
install_jar.

Regards,
Kiran Nair

May 2 '06 #2

P: n/a

"annhere" <an*****************@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...
Hi we have a certain SQL script. From that script we have calls like:
DROP FUNCTION A@
call sqlj.remove_jar( 'AXML')@
CALL SQLJ.REFRESH_CLASSES()@
call sqlj.install_jar( 'file:C:\AXML.jar', 'AXML' )@
CALL SQLJ.REFRESH_CLASSES()@
CREATE FUNCTION A(xml VARCHAR(3000),type VARCHAR(3000))
RETURNS VARCHAR(3000)
EXTERNAL NAME 'AXML:com.AConvertXML.convertXML'
LANGUAGE JAVA
PARAMETER STYLE DB2GENERAL
NOT DETERMINISTIC
FENCED
NO SQL
NO EXTERNAL ACTION
ALLOW PARALLEL
NO DBINFO@

However after running this script we notice that the old AXML jar
hasn't been removed and the newly changed AXML.jar is not being
installed so the changes are not taking effect.
If you are saying that AXML.jar is not being removed from C:\, then I'm not
surprised. It has been my experience that sqlj.install_jar *COPIES* a jar
from wherever you have it, C:\ in your case, to the appropriate directory
within DB2, SQLLIB\FUNCTION\JAR\<schema-name>. Then, sqlj.remove_jar removes
*ONLY THE COPY*, not the original of that jar. I haven't found this
documented anywhere but I believe it to be true since the jars that I put
into DB2 via sqlj.install_jar are still wherever they started out after the
sqlj.install_jar has executed and sqlj._remove_jar doesn't touch the
originals of the jars either.

On the other hand, if you are saying that sqlj.remove_jar is not removing
the DB2 copy of the jar, then there is a problem. Try going to your command
line and simply doing the sqlj.remove_jar from there, then inspect the file
system to make sure the jar is gone. If the sqlj.remove_jar fails, you
should get an error message that you can look up in the Information Center.
For example, you will get SQL20202N if you try to remove a jar that contains
stored procedures which haven't been dropped via DROP PROCEDURE or DROP
SPECIFIC PROCEDURE.

If you get no error message but the DB2 copy of the jar is still there
afterwards, then something very weird is going on that may have more to do
with your operating system than with DB2.
The AXML.jar is kept in the C drive.
Do we need to keep the jar under SQLLIB\functions in the server?
It is fine to leave the original copy of AXML.jar where it is. Just remember
that sqlj.install_jar copies that jar and places it in the appropriate
directory of SQLLIB, which is SQLLIB\FUNCTION\JAR\<schema-name>.
What maybe the possible reasons for saj.install_jar not working?

When sqlj.install_jar fails to work, you should always get an error message.
That message should help you track down why the command failed. You can
prove this to yourself by going to your command line and trying to do a
sqlj.install_jar with an invalid URL; the command should fail with a
reasonably clear error message. An incorrect URL is the most common reason
that sqlj.install_jar would fail, assuming you don't have a syntax error in
the command itself; there must be other reasons but I can't think of any
that are very likely to occur. For example, the command might fail if the
file system was completely full but that isn't likely to happen very often.

--
Rhino
May 2 '06 #3

P: n/a
hi anindita,
As Rhino said , you need to check out the error message. And even you
can check the SQLLIB\FUNCTION\JAR\<schema-name> if the copy is
happening .
Thanks for the details Rhino.

May 2 '06 #4

P: n/a

"Kiran Nair" <ki************@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
hi anindita,
As Rhino said , you need to check out the error message. And even you
can check the SQLLIB\FUNCTION\JAR\<schema-name> if the copy is
happening .
Thanks for the details Rhino.

My pleasure!

--
Rhino
May 2 '06 #5

P: n/a
Hi,
I have tried all that u said. It is indeed removing the copy of the jar
(with sqlj_remove) and installing a fresh copy with sqlj_install
however the changes made in the new jar files still are not being
reflected.
Rhino wrote:
"annhere" <an*****************@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...
Hi we have a certain SQL script. From that script we have calls like:
DROP FUNCTION A@
call sqlj.remove_jar( 'AXML')@
CALL SQLJ.REFRESH_CLASSES()@
call sqlj.install_jar( 'file:C:\AXML.jar', 'AXML' )@
CALL SQLJ.REFRESH_CLASSES()@
CREATE FUNCTION A(xml VARCHAR(3000),type VARCHAR(3000))
RETURNS VARCHAR(3000)
EXTERNAL NAME 'AXML:com.AConvertXML.convertXML'
LANGUAGE JAVA
PARAMETER STYLE DB2GENERAL
NOT DETERMINISTIC
FENCED
NO SQL
NO EXTERNAL ACTION
ALLOW PARALLEL
NO DBINFO@

However after running this script we notice that the old AXML jar
hasn't been removed and the newly changed AXML.jar is not being
installed so the changes are not taking effect.

If you are saying that AXML.jar is not being removed from C:\, then I'm not
surprised. It has been my experience that sqlj.install_jar *COPIES* a jar
from wherever you have it, C:\ in your case, to the appropriate directory
within DB2, SQLLIB\FUNCTION\JAR\<schema-name>. Then, sqlj.remove_jar removes
*ONLY THE COPY*, not the original of that jar. I haven't found this
documented anywhere but I believe it to be true since the jars that I put
into DB2 via sqlj.install_jar are still wherever they started out after the
sqlj.install_jar has executed and sqlj._remove_jar doesn't touch the
originals of the jars either.

On the other hand, if you are saying that sqlj.remove_jar is not removing
the DB2 copy of the jar, then there is a problem. Try going to your command
line and simply doing the sqlj.remove_jar from there, then inspect the file
system to make sure the jar is gone. If the sqlj.remove_jar fails, you
should get an error message that you can look up in the Information Center.
For example, you will get SQL20202N if you try to remove a jar that contains
stored procedures which haven't been dropped via DROP PROCEDURE or DROP
SPECIFIC PROCEDURE.

If you get no error message but the DB2 copy of the jar is still there
afterwards, then something very weird is going on that may have more to do
with your operating system than with DB2.
The AXML.jar is kept in the C drive.
Do we need to keep the jar under SQLLIB\functions in the server?


It is fine to leave the original copy of AXML.jar where it is. Just remember
that sqlj.install_jar copies that jar and places it in the appropriate
directory of SQLLIB, which is SQLLIB\FUNCTION\JAR\<schema-name>.
What maybe the possible reasons for saj.install_jar not working?

When sqlj.install_jar fails to work, you should always get an error message.
That message should help you track down why the command failed. You can
prove this to yourself by going to your command line and trying to do a
sqlj.install_jar with an invalid URL; the command should fail with a
reasonably clear error message. An incorrect URL is the most common reason
that sqlj.install_jar would fail, assuming you don't have a syntax error in
the command itself; there must be other reasons but I can't think of any
that are very likely to occur. For example, the command might fail if the
file system was completely full but that isn't likely to happen very often.

--
Rhino


May 3 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.