I am trying to connect oracle8 Personal Edition with
JDBC. following is my code.
/**********************************************/
import java.sql.*;
public class sample
{
public static void main(String arg[])
{
try
{
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
Connection con=
DriverManager.getConnection("jdbc:oracle:thin:@Sanjeev:1521:ORCL","scott","tiger\
");
Statement smt = con.createStatement();
ResultSet rs = smt.executeQuery("SELECT * FROM
EMP");
while (rs.next())
{
System.out.println(rs.getString(1));
}
con.close();
}
catch (SQLException e)
{
System.out.println("\nerror !!!!\n" + e);
}
}
}
/**************************************/
This code compiles successfully. it throws an
Exception at runtime.
error !!!!
java.sql.SQLException: Connection refused: no further
information
plz. see what is the problem. i am using WIN98,
JDK1.2.2, oracle8.0 personal edition.
is there any problem in code or i need some other
drivers for my platfors, if so where can i find them.