This is a discussion on Newbie - problem accessing DB2 with Java program. within the DB2 forums, part of the Database Server Software category; --> zalek wrote: > In my installation we have DB2 on a mainframe computer. I am able to > access ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 Case matters, I've not used DB2 but are you certain the COM is capitalised? I'd expect com.ibm.db2.jdbc.app.DB2Driver instead of COM.ibm.db2.jdbc.app.DB2Driver Also, you are cross-posting to four newsgroups, a lot of people will have their newsreaders configured to treat highly cross-posted messages as SPAM and ignore them. IME it is better to pick one newsgroup. Followups set to c.l.j.d only. -- RGB |
| ||||
| On Mar 16, 10:17 pm, Arne Vajhøj <a...@vajhoej.dk> wrote: > Alex.From.Ohio.J...@gmail.com wrote: > > Another very nice way to use classes (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 > > Very bad way. > > Builds will break when Java is updated. > > It does not work with multiple versions of the same software. > > Etc.. > > Arne Guys, Thanks to all for your help - Arne was 100% right - it is my fault. After receiving class not found conditions I copied db2java.zip and db2jcc.jar to any possible directory - it does not help. I removed these files, put to only 1 directory and using "properties" in JBuilder I added pointed to this directory - and now my Java program is working. Thanks again! Zalek |