//the code are as following, it works fine on server local machine but not on the client, I have double checked the javapath/jre/ext and I have those zip files for oracle, but the errors still says class not found, any ideas? Thanks
import java.sql.Connection ;
import java.sql.DriverManager ;
import java.sql.ResultSet ;
import java.sql.Statement ;
class JavaOraConn
{
public static void main (String s[])
{
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch (ClassNotFoundException e) {
System.err.println (e) ;
System.exit (-1) ;
}
try {
// open connection to database
Connection connection = DriverManager.getConnection(
"jdbc racle:thin:@ServerIP:1521 ra9i",
"scott", // ## fill in User here
"tiger" // ## fill in Password here
);
// build query
String query = "SELECT * From emp" ;
// execute query
Statement statement = connection.createStatement () ;
ResultSet rs = statement.executeQuery (query) ;
System.out.println ("Test:") ;
while ( rs.next () )
System.out.println (rs.getInt ("empno") + " | " +
rs.getString ("EName") + " | " +
rs.getInt ("MGR")) ;
connection.close () ;
}
catch (java.sql.SQLException e) {
System.err.println (e) ;
System.exit (-1) ;
}
}
}
import java.sql.Connection ;
import java.sql.DriverManager ;
import java.sql.ResultSet ;
import java.sql.Statement ;
class JavaOraConn
{
public static void main (String s[])
{
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch (ClassNotFoundException e) {
System.err.println (e) ;
System.exit (-1) ;
}
try {
// open connection to database
Connection connection = DriverManager.getConnection(
"jdbc racle:thin:@ServerIP:1521 ra9i",
"scott", // ## fill in User here
"tiger" // ## fill in Password here
);
// build query
String query = "SELECT * From emp" ;
// execute query
Statement statement = connection.createStatement () ;
ResultSet rs = statement.executeQuery (query) ;
System.out.println ("Test:") ;
while ( rs.next () )
System.out.println (rs.getInt ("empno") + " | " +
rs.getString ("EName") + " | " +
rs.getInt ("MGR")) ;
connection.close () ;
}
catch (java.sql.SQLException e) {
System.err.println (e) ;
System.exit (-1) ;
}
}
}