aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes confusion in running the program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic
Author

confusion in running the program

yogi maheshnath
Ranch Hand

Joined: Jan 07, 2008
Posts: 30
Hi,

when i am running the following code on command line,i am getting Exception in thread"main"java.lang.NoClassDefFoundError emosql.But,when i am running this code on IDE there is no error.Please explain.
---------------------------------------------------------------------------
import java.sql.*;
public class demosql
{
Connection con;
ResultSet rs;
Statement st;
demosql()
{

try
{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc dbc:mydsn");
st=con.createStatement();
rs=st.executeQuery("select name from emp");
while(rs.next())
{
String str=rs.getString(1);
System.out.println(str);
}
}
catch(Exception e)
{}

}
public static void main(String args[])
{
new demosql();
}
}
-------------------------------------------------------


Thanks&Regards<br />Yogi MaheshNath
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Please continue under the duplicate post, and please don't post duplicates.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: confusion in running the program