473,473 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

sqlj Command Doesn't Work

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
manuals for the proper techniques to prepare an sqlj program. When I went to
try the sqlj command, I got this:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj

At first I thought this might be a PATH issue but when I went into the
sqllib/bin directory, I got the same result, even though sqlj.exe is right
there. I was simply doing this command:

sqlj help

I checked Google and can't find any record of anyone else having this
problem. I can't see anything in the manuals about any special setup that I
have to do to make the sqlj command work. I know the command still exists
because it is still documented in the manuals.

Does anyone have any idea why the command isn't working?

For what it's worth, I also tried to use the bldsqljs.bat batch file in the
samples\java\sqlj directory but the same thing happens. For example, given
this command:

bldsqljs SpServer rhino rhinopw

I get:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj
Exception in thread "main" java.lang.NoClassDefFoundError:
com/ibm/db2/jcc/sqlj/Customizer
The syntax of the command is incorrect.
The syntax of the command is incorrect.

I'm following the instructions in the manual but both the sqlj and
db2sqljcustomize commands don't work. What's wrong?
--
Rhino
Nov 12 '05 #1
12 5291
Rhino wrote:
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 manuals for the proper techniques to prepare an sqlj program. When I
went to try the sqlj command, I got this:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj


Did you already look at the tutorials at developerWorks?

http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB
http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB
https://www14.software.ibm.com/webap...rce=dw-db2sqlj

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2

"Knut Stolze" <st****@de.ibm.com> wrote in message
news:d2**********@fsuj29.rz.uni-jena.de...
Rhino wrote:
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 manuals for the proper techniques to prepare an sqlj program. When I
went to try the sqlj command, I got this:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj
Did you already look at the tutorials at developerWorks?

http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB https://www14.software.ibm.com/webap...rce=dw-db2sqlj

Thanks for the suggestions, Knut, but I already know the basics of how to
use SQLJ; I did a few SQLJ programs back in DB2 V6.1. I checked out these
links anyway (the second one is dead by the way) but they don't seem to
touch on my problem.

I don't see why this command:

sqlj help

shouldn't work, especially if I execute it in the sqllib/bin directory, but
I get this message instead of help information regardless of where I run the
command:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj

It looks like some kind of installation/setup issue but I don't have any
idea where to look. The file sqlj.exe is present in sqllib/bin and sqlj.zip
is present in sqllib/java. Is there anything else I need to do to make the
sqlj command work??

I'm running DB2 V8 (Linux, Unix, and Windows) Fixpack 8, on Windows XP.

Rhino
Nov 12 '05 #3
Rhino wrote:
"Knut Stolze" <st****@de.ibm.com> wrote in message
news:d2**********@fsuj29.rz.uni-jena.de...
Rhino wrote:

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 manuals for the proper techniques to prepare an sqlj program. When I
went to try the sqlj command, I got this:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj


Did you already look at the tutorials at developerWorks?


http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB

http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB

https://www14.software.ibm.com/webap...rce=dw-db2sqlj

Thanks for the suggestions, Knut, but I already know the basics of how to
use SQLJ; I did a few SQLJ programs back in DB2 V6.1. I checked out these
links anyway (the second one is dead by the way) but they don't seem to
touch on my problem.

I don't see why this command:

sqlj help

shouldn't work, especially if I execute it in the sqllib/bin directory, but
I get this message instead of help information regardless of where I run the
command:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj

It looks like some kind of installation/setup issue but I don't have any
idea where to look. The file sqlj.exe is present in sqllib/bin and sqlj.zip
is present in sqllib/java. Is there anything else I need to do to make the
sqlj command work??

I'm running DB2 V8 (Linux, Unix, and Windows) Fixpack 8, on Windows XP.

Rhino

Here is - I presume - expected output?:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>sqlj help
Error: help is not a valid input filename
Total 1 error.
Jan M. Nelken
Nov 12 '05 #4
Jan M. Nelken wrote:
Here is - I presume - expected output?:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>sqlj help
Error: help is not a valid input filename
Total 1 error.


Sorry - case of premature ENTERnization ...

Perhaps this is what you wanted to try:

C:\>sqlj -help
Usage: sqlj [options] file1.sqlj [file2.java] ...
where options include:
-d=<directory> root directory for generated binary files
-encoding=<encoding> Java encoding for source files
-status print status during translation
-compile=false do not compile generated Java files
-linemap instrument compiled class files from sqlj source
-ser2class convert generated *.ser files to *.class files
-C-<option> pass -<option> to compiler
-C-help get help on compiler
-C-classpath classpath for translation and compilation
-C-sourcepath sourcepath for translation and compilation
-J-<option> pass -<option> to the JavaVM running SQLJ
-version get SQLJ version
-smap create SMAP file for Java Debugging Support
-db2optimize generate DB2 specific optimized code for Connectio
n context

Note: place -<key>=<value> in sqlj.properties as sqlj.<key>=<value>
Jan M. Nelken
Nov 12 '05 #5
On 3/30/2005 14:00, Jan M. Nelken wrote:
Rhino wrote:
"Knut Stolze" <st****@de.ibm.com> wrote in message
news:d2**********@fsuj29.rz.uni-jena.de...
Rhino wrote:
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 manuals for the proper techniques to prepare an sqlj program. When I
went to try the sqlj command, I got this:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj

Did you already look at the tutorials at developerWorks?


http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB

http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB

https://www14.software.ibm.com/webap...rce=dw-db2sqlj

Thanks for the suggestions, Knut, but I already know the basics of how to
use SQLJ; I did a few SQLJ programs back in DB2 V6.1. I checked out these
links anyway (the second one is dead by the way) but they don't seem to
touch on my problem.

I don't see why this command:

sqlj help

shouldn't work, especially if I execute it in the sqllib/bin directory, but
I get this message instead of help information regardless of where I run the
command:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj

It looks like some kind of installation/setup issue but I don't have any
idea where to look. The file sqlj.exe is present in sqllib/bin and sqlj.zip
is present in sqllib/java. Is there anything else I need to do to make the
sqlj command work??

I'm running DB2 V8 (Linux, Unix, and Windows) Fixpack 8, on Windows XP.

Rhino

Here is - I presume - expected output?:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>sqlj help
Error: help is not a valid input filename
Total 1 error.
Jan M. Nelken


I don't run sqlj, but here is what I get when I run it with -help
from the command line:

bin/sqlj -help
Usage: sqlj [options] file1.sqlj [file2.java] ...
where options include:
-d=<directory> root directory for generated binary files
-encoding=<encoding> Java encoding for source files
-status print status during translation
-compile=false do not compile generated Java files
-linemap instrument compiled class files from sqlj source
-ser2class convert generated *.ser files to *.class files
-C-<option> pass -<option> to compiler
-C-help get help on compiler
-J-<option> pass -<option> to the JavaVM running SQLJ
-version get SQLJ version
-smap create SMAP file for Java Debugging Support
Note: place -<key>=<value> in sqlj.properties as sqlj.<key>=<value>

DB2 doesn't allow the running of a lot of its utilities unless you
have a lot of environment variables set. For example, when I try to
run db2.exe, it says:

DB21061E Command line environment not initialized.

Perhaps sqlj.exe expects you to have the various Jar files in
their 'java' directory on the CLASSPATH variable?

Also, try running the DB2 command window (which provides a CMD.EXE
style window with the DB2 environment all set up) and see if you
can run the sqlj process from there?

Sorry, I'm just guessing here. I do very little with DB2.
Nov 12 '05 #6

"Mark Hansen" <me*@NOSPAMunify.com> wrote in message
news:11*************@corp.supernews.com...
On 3/30/2005 14:00, Jan M. Nelken wrote:
Rhino wrote:
"Knut Stolze" <st****@de.ibm.com> wrote in message
news:d2**********@fsuj29.rz.uni-jena.de...

Rhino wrote:
>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 manuals for the proper techniques to prepare an sqlj program. When I>went to try the sqlj command, I got this:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
>sqlj/tools/Sqlj

Did you already look at the tutorials at developerWorks?

http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB
http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB
https://www14.software.ibm.com/webap...rce=dw-db2sqlj
Thanks for the suggestions, Knut, but I already know the basics of how to use SQLJ; I did a few SQLJ programs back in DB2 V6.1. I checked out these links anyway (the second one is dead by the way) but they don't seem to
touch on my problem.

I don't see why this command:

sqlj help

shouldn't work, especially if I execute it in the sqllib/bin directory, but I get this message instead of help information regardless of where I run the command:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj

It looks like some kind of installation/setup issue but I don't have any idea where to look. The file sqlj.exe is present in sqllib/bin and sqlj.zip is present in sqllib/java. Is there anything else I need to do to make the sqlj command work??

I'm running DB2 V8 (Linux, Unix, and Windows) Fixpack 8, on Windows XP.

Rhino

Here is - I presume - expected output?:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>sqlj help
Error: help is not a valid input filename
Total 1 error.
Jan M. Nelken


I don't run sqlj, but here is what I get when I run it with -help
from the command line:

bin/sqlj -help
Usage: sqlj [options] file1.sqlj [file2.java] ...
where options include:
-d=<directory> root directory for generated binary files
-encoding=<encoding> Java encoding for source files
-status print status during translation
-compile=false do not compile generated Java files
-linemap instrument compiled class files from sqlj

source -ser2class convert generated *.ser files to *.class files -C-<option> pass -<option> to compiler
-C-help get help on compiler
-J-<option> pass -<option> to the JavaVM running SQLJ
-version get SQLJ version
-smap create SMAP file for Java Debugging Support
Note: place -<key>=<value> in sqlj.properties as sqlj.<key>=<value>

DB2 doesn't allow the running of a lot of its utilities unless you
have a lot of environment variables set. For example, when I try to
run db2.exe, it says:

DB21061E Command line environment not initialized.

Perhaps sqlj.exe expects you to have the various Jar files in
their 'java' directory on the CLASSPATH variable?

Also, try running the DB2 command window (which provides a CMD.EXE
style window with the DB2 environment all set up) and see if you
can run the sqlj process from there?
I get the same error message when I run the command from a DB2 Command
Window.
Sorry, I'm just guessing here. I do very little with DB2.


I think you may be on to something anyway; this feels like a setup problem
and I suspect that you're right about having to set some environment
variables to make sqlj work. Unfortunately, I don't know which ones! I can't
find anything that looks like an sqlj setup checklist in the manuals but
maybe I just haven't looked in the right places or specified the right
search terms.

If anyone can point me to such a list, I would greatly appreciate it.
Obviously, something is wrong in my environment but I have no idea what to
look for.

Rhino
Nov 12 '05 #7

"Jan M. Nelken" <Un**********@Invalid.Domain> wrote in message
news:42********@news1.prserv.net...
Jan M. Nelken wrote:
Here is - I presume - expected output?:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>sqlj help
Error: help is not a valid input filename
Total 1 error.
Sorry - case of premature ENTERnization ...

Perhaps this is what you wanted to try:

C:\>sqlj -help
Usage: sqlj [options] file1.sqlj [file2.java] ...
where options include:
-d=<directory> root directory for generated binary files
-encoding=<encoding> Java encoding for source files
-status print status during translation
-compile=false do not compile generated Java files
-linemap instrument compiled class files from sqlj

source -ser2class convert generated *.ser files to *.class files -C-<option> pass -<option> to compiler
-C-help get help on compiler
-C-classpath classpath for translation and compilation
-C-sourcepath sourcepath for translation and compilation
-J-<option> pass -<option> to the JavaVM running SQLJ
-version get SQLJ version
-smap create SMAP file for Java Debugging Support
-db2optimize generate DB2 specific optimized code for Connectio n context

Note: place -<key>=<value> in sqlj.properties as sqlj.<key>=<value>

Thanks, Jan, for your suggestions. I tried using a full and complete sqlj
command with the various parameters supplied as per your note before I ever
posted in the first place and always got the same error message:

Exception in thread "main" java.lang.NoClassDefFoundError:
sqlj/tools/Sqlj
Finally, I tried the simplest possible case: I did an sqlj -help (which I
mistyped in my original note as 'sqlj help') from the sqllib/bin directory
where the sqlj command resides and still got the same error message.
According to the manuals 'sqlj -help' is a perfectly valid command and
should produce meaningful results, not the error message I am getting.

This feels like some kind of a setup issue; perhaps I need to run some kind
of setup script or environment variable before the sqlj command will work.
But I have no idea what I need to do and can't find anything in the manual.

Rhino
Nov 12 '05 #8
On 3/31/2005 06:50, Rhino wrote:
"Mark Hansen" <me*@NOSPAMunify.com> wrote in message
news:11*************@corp.supernews.com...
On 3/30/2005 14:00, Jan M. Nelken wrote:
> Rhino wrote:
>> "Knut Stolze" <st****@de.ibm.com> wrote in message
>> news:d2**********@fsuj29.rz.uni-jena.de...
>>
>>>Rhino wrote:
>>>
>>>
>>>>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 manuals for the proper techniques to prepare an sqlj program. When I >>>>went to try the sqlj command, I got this:
>>>>
>>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>>>sqlj/tools/Sqlj
>>>
>>>Did you already look at the tutorials at developerWorks?
>>>
>>>
>>
>> http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB >>
>> http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB >>
>> https://www14.software.ibm.com/webap...rce=dw-db2sqlj >>
>> Thanks for the suggestions, Knut, but I already know the basics of how to >> use SQLJ; I did a few SQLJ programs back in DB2 V6.1. I checked out these >> links anyway (the second one is dead by the way) but they don't seem to
>> touch on my problem.
>>
>> I don't see why this command:
>>
>> sqlj help
>>
>> shouldn't work, especially if I execute it in the sqllib/bin directory, but >> I get this message instead of help information regardless of where I run the >> command:
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> sqlj/tools/Sqlj
>>
>> It looks like some kind of installation/setup issue but I don't have any >> idea where to look. The file sqlj.exe is present in sqllib/bin and sqlj.zip >> is present in sqllib/java. Is there anything else I need to do to make the >> sqlj command work??
>>
>> I'm running DB2 V8 (Linux, Unix, and Windows) Fixpack 8, on Windows XP.
>>
>> Rhino
>>
>>
>
>
> Here is - I presume - expected output?:
>
> Microsoft Windows XP [Version 5.1.2600]
> (C) Copyright 1985-2001 Microsoft Corp.
>
> C:\>sqlj help
> Error: help is not a valid input filename
> Total 1 error.
>
>
> Jan M. Nelken


I don't run sqlj, but here is what I get when I run it with -help
from the command line:

bin/sqlj -help
Usage: sqlj [options] file1.sqlj [file2.java] ...
where options include:
-d=<directory> root directory for generated binary files
-encoding=<encoding> Java encoding for source files
-status print status during translation
-compile=false do not compile generated Java files
-linemap instrument compiled class files from sqlj

source
-ser2class convert generated *.ser files to *.class

files
-C-<option> pass -<option> to compiler
-C-help get help on compiler
-J-<option> pass -<option> to the JavaVM running SQLJ
-version get SQLJ version
-smap create SMAP file for Java Debugging Support
Note: place -<key>=<value> in sqlj.properties as sqlj.<key>=<value>

DB2 doesn't allow the running of a lot of its utilities unless you
have a lot of environment variables set. For example, when I try to
run db2.exe, it says:

DB21061E Command line environment not initialized.

Perhaps sqlj.exe expects you to have the various Jar files in
their 'java' directory on the CLASSPATH variable?

Also, try running the DB2 command window (which provides a CMD.EXE
style window with the DB2 environment all set up) and see if you
can run the sqlj process from there?

I get the same error message when I run the command from a DB2 Command
Window.
Sorry, I'm just guessing here. I do very little with DB2.


I think you may be on to something anyway; this feels like a setup problem
and I suspect that you're right about having to set some environment
variables to make sqlj work. Unfortunately, I don't know which ones! I can't
find anything that looks like an sqlj setup checklist in the manuals but
maybe I just haven't looked in the right places or specified the right
search terms.

If anyone can point me to such a list, I would greatly appreciate it.
Obviously, something is wrong in my environment but I have no idea what to
look for.

Rhino


The error your getting is a Java error that it can't find a class.
You should try setting the CLASSPATH environment variable to the
Jar in the DB2/java directory that contains that class, then repeate
as necessary to get the thing working.

This assumes of course that the sqlj executable doesn't override the
CLASSPATH setting.

The current error was:
>>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>>>sqlj/tools/Sqlj


So look for a Jar file that contains "sqlj/tools/Sqlj.class", and
put it on the CLASSPATH setting.

CLASSPATH is set just like PATH. So on Windows platforms, like looks
like this:

"path to Jar;path to Jar2;path to Jar3;"

It can include elements besides Jars, but you get the idea...
--
Mark Hansen, PP-ASEL
Sacramento, CA
Nov 12 '05 #9

"Mark Hansen" <me*@NOSPAMunify.com> wrote in message
news:11*************@corp.supernews.com...
On 3/31/2005 06:50, Rhino wrote:
"Mark Hansen" <me*@NOSPAMunify.com> wrote in message
news:11*************@corp.supernews.com...
On 3/30/2005 14:00, Jan M. Nelken wrote:

> Rhino wrote:
>> "Knut Stolze" <st****@de.ibm.com> wrote in message
>> news:d2**********@fsuj29.rz.uni-jena.de...
>>
>>>Rhino wrote:
>>>
>>>
>>>>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 manuals for the proper techniques to prepare an sqlj program. When
I
>>>>went to try the sqlj command, I got this:
>>>>
>>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>>>sqlj/tools/Sqlj
>>>
>>>Did you already look at the tutorials at developerWorks?
>>>
>>>
>>
>>

http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB >>
>>

http://www.ibm.com/developerworks/ed...HW11&S_CMP=LIB
>>
>>

https://www14.software.ibm.com/webap...rce=dw-db2sqlj
>>
>> Thanks for the suggestions, Knut, but I already know the basics of how to
>> use SQLJ; I did a few SQLJ programs back in DB2 V6.1. I checked out

these
>> links anyway (the second one is dead by the way) but they don't seem
to >> touch on my problem.
>>
>> I don't see why this command:
>>
>> sqlj help
>>
>> shouldn't work, especially if I execute it in the sqllib/bin directory,
but
>> I get this message instead of help information regardless of where I

run the
>> command:
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> sqlj/tools/Sqlj
>>
>> It looks like some kind of installation/setup issue but I don't have

any
>> idea where to look. The file sqlj.exe is present in sqllib/bin and

sqlj.zip
>> is present in sqllib/java. Is there anything else I need to do to
make the
>> sqlj command work??
>>
>> I'm running DB2 V8 (Linux, Unix, and Windows) Fixpack 8, on Windows
XP. >>
>> Rhino
>>
>>
>
>
> Here is - I presume - expected output?:
>
> Microsoft Windows XP [Version 5.1.2600]
> (C) Copyright 1985-2001 Microsoft Corp.
>
> C:\>sqlj help
> Error: help is not a valid input filename
> Total 1 error.
>
>
> Jan M. Nelken

I don't run sqlj, but here is what I get when I run it with -help
from the command line:

bin/sqlj -help
Usage: sqlj [options] file1.sqlj [file2.java] ...
where options include:
-d=<directory> root directory for generated binary files -encoding=<encoding> Java encoding for source files
-status print status during translation
-compile=false do not compile generated Java files
-linemap instrument compiled class files from sqlj source
-ser2class convert generated *.ser files to *.class

files
-C-<option> pass -<option> to compiler
-C-help get help on compiler
-J-<option> pass -<option> to the JavaVM running
SQLJ -version get SQLJ version
-smap create SMAP file for Java Debugging Support Note: place -<key>=<value> in sqlj.properties as sqlj.<key>=<value>

DB2 doesn't allow the running of a lot of its utilities unless you
have a lot of environment variables set. For example, when I try to
run db2.exe, it says:

DB21061E Command line environment not initialized.

Perhaps sqlj.exe expects you to have the various Jar files in
their 'java' directory on the CLASSPATH variable?

Also, try running the DB2 command window (which provides a CMD.EXE
style window with the DB2 environment all set up) and see if you
can run the sqlj process from there?

I get the same error message when I run the command from a DB2 Command
Window.
Sorry, I'm just guessing here. I do very little with DB2.


I think you may be on to something anyway; this feels like a setup

problem and I suspect that you're right about having to set some environment
variables to make sqlj work. Unfortunately, I don't know which ones! I can't find anything that looks like an sqlj setup checklist in the manuals but
maybe I just haven't looked in the right places or specified the right
search terms.

If anyone can point me to such a list, I would greatly appreciate it.
Obviously, something is wrong in my environment but I have no idea what to look for.

Rhino


The error your getting is a Java error that it can't find a class.
You should try setting the CLASSPATH environment variable to the
Jar in the DB2/java directory that contains that class, then repeate
as necessary to get the thing working.

This assumes of course that the sqlj executable doesn't override the
CLASSPATH setting.

The current error was:
>> >>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> >>>>sqlj/tools/Sqlj


So look for a Jar file that contains "sqlj/tools/Sqlj.class", and
put it on the CLASSPATH setting.

CLASSPATH is set just like PATH. So on Windows platforms, like looks
like this:

"path to Jar;path to Jar2;path to Jar3;"

It can include elements besides Jars, but you get the idea...

I've just gone over the list of instructions in the "Setting up the Java
environment" and "Setting up the Windows Java environment" sections of the
Info Center again and feel that I am doing everything that they require. The
only change I made was the sequence of the jars in the classpath; the manual
insisted that the db2java.zip, db2jcc.jar, db2jcc_license_cu.jar, and
sqlj.zip jars were first in the classpath and they weren't so I moved them
to immediately after the '.' directory. I saved the environment variables
and rebooted to make sure that the changes had taken effect but I still got
the same error at both a regular command prompt and the DB2 Command Window.

I also had a look at the DB2 environment variables to see if anything there
looked like it might affect SQLJ but I couldn't see anything other than
DB2COMM; DB2COMM is already set to TCPIP.

I also had a look at sqlj.zip and verified that it contains Sqlj.class; the
path for this class is sqlj\tools
and sqlj.zip is in my classpath.

I'm really baffled here. I've spent hours messing with this and can't get to
square one.

I have no problems writing, preparing and running JDBC programs but I can't
do *anything* with SQLJ.

Does anyone have any ideas?

Rhino

Nov 12 '05 #10
I have resolved my problem with the sqlj command.

In case anyone else ever has the same problem and researches it via Google,
the solution to the problem was very simple. First, a bit of background.

In the course of playing with my classpath to try to resolve this problem, I
noticed that I had two classpath environment variables, one a 'user'
variable and one a 'system' variable. I'm running Windows XP Pro. The 'user'
version of classpath pointed only to a Photo editing program I have; the
'system' version of classpath pointed to all of my DB2 Java/SQL jars and
zips.

My system has been like this for a few years now and this has never been a
problem up to now. I'd always just assumed that Windows was concatenating
the two classpaths together and never really touched the 'user' classpath:
whenever I had a change to make, I made it to the 'system' classpath and it
always seemed to work.

However, because the sqlj command (and db2sqljcustomize) were always getting
classpath errors even though I had the correct jars and zips in the 'system'
classpath, I began to suspect that only the 'user' classpath was being seen,
NOT the concatenation of both the 'user' and 'system' classpath. I posted to
a couple of newsgroups to ask about this and was told that if the same
environment variable was defined in both the 'user' and 'system' areas, the
'user' one took precedence and the 'system' was ignored, i.e. there is no
concatenation!

The solution to the problem was easy: I added the contents of my 'user'
classpath to my 'system' classpath and deleted the 'used' classpath. My sqlj
and db2sqljcustomize commands immediately began working; I didn't even have
to reboot. (One of the people who replied to my question gave me a link to
an article that said you normally have to reboot before you will see changes
to 'system' environment variables.)

--

The thing that I don't understand about this is why everything except the
sqlj/db2sqljcustomize commands worked so well for several years when I had
two different versions of the classpath running. I would have thought that
all of my DB2 Java-related stuff would have given me big problems years ago
due to this situation. But, somehow, everything was fine right up until I
started to play with sqlj.

Perhaps this will make sense once I have thought about it some more....

Rhino
Nov 12 '05 #11
On 4/1/2005 05:57, Rhino wrote:
I have resolved my problem with the sqlj command.

In case anyone else ever has the same problem and researches it via Google,
the solution to the problem was very simple. First, a bit of background.

In the course of playing with my classpath to try to resolve this problem, I
noticed that I had two classpath environment variables, one a 'user'
variable and one a 'system' variable. I'm running Windows XP Pro. The 'user'
version of classpath pointed only to a Photo editing program I have; the
'system' version of classpath pointed to all of my DB2 Java/SQL jars and
zips.

My system has been like this for a few years now and this has never been a
problem up to now. I'd always just assumed that Windows was concatenating
the two classpaths together and never really touched the 'user' classpath:
whenever I had a change to make, I made it to the 'system' classpath and it
always seemed to work.

However, because the sqlj command (and db2sqljcustomize) were always getting
classpath errors even though I had the correct jars and zips in the 'system'
classpath, I began to suspect that only the 'user' classpath was being seen,
NOT the concatenation of both the 'user' and 'system' classpath. I posted to
a couple of newsgroups to ask about this and was told that if the same
environment variable was defined in both the 'user' and 'system' areas, the
'user' one took precedence and the 'system' was ignored, i.e. there is no
concatenation!
This is true for *all* variables on Windows. This has nothing to do
with Java, DB2 or the CLASSPATH setting in particular.

The "User" setting for a variable will always override the "System"
setting for that variable. If you want to include the System setting
in the User setting, you can set the User variable like this:

%CLASSPATH%;user-classpath-entries

That way, your User classpath setting will be set to the System classpath
setting, then any of your additional setting will be added on to the
end.


The solution to the problem was easy: I added the contents of my 'user'
classpath to my 'system' classpath and deleted the 'used' classpath. My sqlj
and db2sqljcustomize commands immediately began working; I didn't even have
to reboot. (One of the people who replied to my question gave me a link to
an article that said you normally have to reboot before you will see changes
to 'system' environment variables.)
Or, you could have just corrected the "User" setting, as mentioned above.

--

The thing that I don't understand about this is why everything except the
sqlj/db2sqljcustomize commands worked so well for several years when I had
two different versions of the classpath running. I would have thought that
all of my DB2 Java-related stuff would have given me big problems years ago
due to this situation. But, somehow, everything was fine right up until I
started to play with sqlj.

Perhaps this will make sense once I have thought about it some more....

Rhino


Nov 12 '05 #12

"Mark Hansen" <me*@NOSPAMunify.com> wrote in message
news:11*************@corp.supernews.com...
On 4/1/2005 05:57, Rhino wrote:
I have resolved my problem with the sqlj command.

In case anyone else ever has the same problem and researches it via Google, the solution to the problem was very simple. First, a bit of background.

In the course of playing with my classpath to try to resolve this problem, I noticed that I had two classpath environment variables, one a 'user'
variable and one a 'system' variable. I'm running Windows XP Pro. The 'user' version of classpath pointed only to a Photo editing program I have; the
'system' version of classpath pointed to all of my DB2 Java/SQL jars and
zips.

My system has been like this for a few years now and this has never been a problem up to now. I'd always just assumed that Windows was concatenating the two classpaths together and never really touched the 'user' classpath: whenever I had a change to make, I made it to the 'system' classpath and it always seemed to work.

However, because the sqlj command (and db2sqljcustomize) were always getting classpath errors even though I had the correct jars and zips in the 'system' classpath, I began to suspect that only the 'user' classpath was being seen, NOT the concatenation of both the 'user' and 'system' classpath. I posted to a couple of newsgroups to ask about this and was told that if the same
environment variable was defined in both the 'user' and 'system' areas, the 'user' one took precedence and the 'system' was ignored, i.e. there is no concatenation!
This is true for *all* variables on Windows. This has nothing to do
with Java, DB2 or the CLASSPATH setting in particular.

Yes, I know that *now* but I didn't know at the time that I posted the
original question. In hindsight, this was not a DB2 problem at all. However,
since this is the first time the problem manifested itself and it was only a
problem in DB2, it seemed reasonable to think it might be a DB2 problem.
Now, of course, I know better.
The "User" setting for a variable will always override the "System"
setting for that variable. If you want to include the System setting
in the User setting, you can set the User variable like this:

%CLASSPATH%;user-classpath-entries

That way, your User classpath setting will be set to the System classpath
setting, then any of your additional setting will be added on to the
end.
Sure, I suppose that would work too, PROVIDED that Windows was getting the
value of
%CLASSPATH% from the system version of the variable. I'm not certain of that
myself - it didn't come up in any of the other posts or references I saw -
but it is very possibly true. But getting rid of one of the classpaths makes
the whole thing that much less ambiguous; there is only one now so there is
no doubt whatever about which classpath is being used.

The solution to the problem was easy: I added the contents of my 'user'
classpath to my 'system' classpath and deleted the 'used' classpath. My sqlj and db2sqljcustomize commands immediately began working; I didn't even have to reboot. (One of the people who replied to my question gave me a link to an article that said you normally have to reboot before you will see changes to 'system' environment variables.)


Or, you could have just corrected the "User" setting, as mentioned above.

Rhino
Nov 12 '05 #13

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

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...
5
by: Raquel | last post by:
This is a very simple DB2 SQLJ stored procedure. The problem is that it seems to run fine but returns NOTHING. I mean..as if nothing has happened..not resultset is returned. I am passing value...
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...
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...
0
by: shibubaby | last post by:
Hi All, I am trying to compile some embedded SQL using the SQLJ in DB2 environment. My setup is as follows. 1) Fedora Core 5 2)IBM DB2 V8.2 I installed both the client/admin tools in the DB2...
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: 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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.