On Mar 16, 9:37 pm, Alex.From.Ohio.J...@[EMAIL PROTECTED]
wrote:
> On Mar 16, 7:04 pm, zalek <zalekbl...@[EMAIL PROTECTED]
> wrote:
>
>
>
> > On Mar 16, 7:21 pm, Arne Vajh=F8j <a...@[EMAIL PROTECTED]
> wrote:
>
> > > zalek wrote:
> > > > On Mar 16, 6:49 pm, Arne Vajh=F8j <a...@[EMAIL PROTECTED]
> wrote:
> > > >> zalek wrote:
> > > >>> In my installation we have DB2 on a mainframe computer. I am
able =
to
> > > >>> access DB2 from my PC (WinXP) using some utilities. I wrote a
Java=
> > > >>> program to access DB2, but I am getting errors.
> > > >>> After command:
> > > >>> Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
> > > >>> I am getting exception:
> > > >>> Exception java.lang.ClassNotFoundException:
> > > >>> COM.ibm.db2.jdbc.app.DB2Driver
> > > >>> I copied db2java.zip and db2jcc.jar files to a default directory
o=
f
> > > >>> JBuilder, even to the same directory where I have my program,
but=
it
> > > >>> did not help.
> > > >>> What I am doing wrong?
> > > >> You need to put the JDBC driver jar file in classpath. Just
putting=
> > > >> then in those directories does not put them in classpath.
>
> > > > I tried - it did not help.
> > > > I am using JBuilder to write my program, so I moved db2java.zip
and
> > > > db2jcc.jar to
> > > > C:\JBuilder2005\jdk1.4\bin and
> > > > C:\JBuilder2005\jdk1.4\lib
>
> > > > On top of it I found a directory in a classpath variable and move
th=
is
> > > > files to this directory - nothing helped. Still getting the same
> > > > error.
>
> > > I repeat:
>
> > > Just putting a jar file in a directory does not put it in classpath.
>
> > > (with a few exceptions that does not apply here)
>
> > > You need explicitly to tell JBuilder to use this jar file.
>
> > > Arne
>
> > Thanks Arne,
>
> > I added files to JBuilder classpath, so now the im****t command is
> > working and it shows DB2Driver, here is a picture from my
program:http:/=
/www.geocities.com/bloomzalek/pictures/java.JPG
> > but still I am getting:
> > Exception java.lang.ClassNotFoundException:
> > COM.ibm.db2.jdbc.net.DB2Driver
>
> > Thanks,
>
> > Zalek
>
> Another very nice way to use cl***** (actually jar files) without
> touching classpath is to put these jar files to the $JAVA_HOME/jre/lib/
> ext/ directory.
> For example, in my case, when I put db2java.zip and
> db2jcc.jar to the
> "C:\Program Files\Java\jre1.6.0_03\lib\ext\"
> it is available for any Java application.
>
> Just make sure that you put these jar files to the Java what you use!
> Or put it to the all Java installations on your computer if you are
> not sure which one you use ;)
>
> Alex.http://www.myjavaserver.com/~alexfromohio/
>
> http://www.myjavaserver.com/~alexfromohio/
Alex,
This is what I don't understand. Im****t command shows that the package
COM.ibm.db2.jdbc.net.DB2Driver is available - it shows also it
includes DB2Driver class. So why I am getting a message class not
found?
Zalek


|