java.lang.NoClassDefFoundError

Hello,

I am trying to write a simple jdbc code with connectivity with the oracle database but i am getting the following error:

C:\Sun\SDK\jdk>java Test

Exception in thread "main" java.lang.NoClassDefFoundError: Test

I downloaded the jdbc drivers for oracle and copied them into my tomcat libraary and i even set the classpath but i am still getting this error. Can someone please tell me what to do to solve this error. Any help will be really appreciated.

Thank you

Noopz

[519 byte] By [noopur26a] at [2007-11-26 20:42:57]
# 1
The problem is not finding the JDBC driver, but your Test class.If Test.class is located in c:\test\Test.class thenjava -cp c:\test Testshould work (assuming the environment CLASSPATH variable has the JDBC drivers on it)
benubacha at 2007-7-10 2:02:59 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

i hope u haven't placed the .class file under the webapps folder and then try it out i hope that is only the problem .r i hope u have made some mistake in the .xml file while giving the class name

<web-app>

<servlet>

<servlet-name>name</servlet-name>i hope u might made mistake some where here.

,servlet-class>/name</servlet-class>

</servlet>

<servlet-mapping>

-

</servlet-mapping>

</web-apps>

try this one of them works properly

nagasekhara at 2007-7-10 2:02:59 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
may be in your class path u may not include .(current directory)with that one better to use one batch file for setting classpath this way also can help u for some extend.
RAJESHa at 2007-7-10 2:02:59 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...