0

I have a problem connecting to IBM (universal) database using JDBC. I wrote the code in Notepad using Java and I loaded drivers of IBM database i.e(driver name and connection URl). When I run the code using general compilation (javac code.java and java code) I am getting an error message "cannot find the driver" but I specified the correct driver name for that. Actually I did this program using Eclipse using the same database with same driver name and all and finally I succeeded, but I cant get this without using an IDE. So please help me how to connect without the IDE and how to run it in a command prompt.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
user276997
  • 11
  • 2
  • If you don't want to use an IDE for development, you should at least try using notepad++ http://notepad-plus.sourceforge.net/ with syntax highlighting and code formatting etc. Your problem as mentioned by Kaleb is probably a classpath issue. – crowne Feb 19 '10 at 14:25

1 Answers1

2

You need to include the necessary JAR files on the classpath when you run your program on the command line.

If you're using IBM's DB2 UDB database, the required driver file is db2jcc.jar, and I think db2jcc_license_cisuz.jar and db2jcc_license_cu.jar are necessary for licensing as well. Search for those files, and include them on the classpath when you run your program from the command line.

Kaleb Brasee
  • 51,193
  • 8
  • 108
  • 113