jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes Java,Oracle on Solaris need Help Uragent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Java,Oracle on Solaris need Help Uragent" Watch "Java,Oracle on Solaris need Help Uragent" New topic
Author

Java,Oracle on Solaris need Help Uragent

javahelp
Greenhorn

Joined: Feb 01, 2001
Posts: 6
Hi,
I have installed JDK1.2.2 and oracle 8.1.6 on Solaris 2.8(Unix).
I am able to compile and execute simple java programs. Now Iam trying to run jdbc programs.
In order to do that I downloaded Oracle driver for Solaris and added classpath with classes12.zip. Now my Jdbc programs as well as simple programs are compiling successfully but not executing. Any help to soleve this problem is appreciated.
gdgd% echo $CLASSPATH
/emc/bsugeera/classes12.zip

gdgd% javac Employee.java
gdgd% java Employee
Exception in thread "main" java.lang.NoClassDefFoundError: Employee
gdgd%

Sorce code for Employee.javaclass Employee
import java.sql.*;
class Employee
{
public static void main (String args [])
throws SQLException
{

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

Connection conn =
DriverManager.getConnection ("jdbc racle ci8:@servername.port.dbname", "scott", "tiger");

Statement stmt = conn.createStatement ();

ResultSet rset = stmt.executeQuery ("select ENAME from EMP");
while (rset.next ())
System.out.println (rset.getString (1));

rset.close();

stmt.close();
conn.close();
}
}

Thanks in Advance.
Basu
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
Hello,
The NoClassDefFoundError is usually thrown if the Java Virtual Machine or a classloader tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.
The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found

Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
javahelp:
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.
Thanks.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java,Oracle on Solaris need Help Uragent