Hello ,
Im new to java . I'm trying to connect to my own Oracle 10g database ( Release 2 ) . But it isnt working .


import java.sql.*;
import oracle.*;

public class conectareSQL {
public static void main(String[] args) throws InstantiationException, IllegalAccessException {
Connection connection = null;
try {
// Load the JDBC driver
String driverName = "oracle.jdbc.driver.OracleDriver";
Class.forName(driverName);

// Create a connection to the database
String serverName = "robert-pc";
String portNumber = "5561";
String sid = "orcl2";
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
String username = "Student1";
String password = "student";
connection = DriverManager.getConnection(url, username, password);
} catch (ClassNotFoundException e) {
System.err.println("Error could not find the datavase driver" + e);
// Could not find the database driver
} catch (SQLException e) {
// Could not connect to the database
System.err.println("Error Could not connect to the database " + e);
}
}
}


I get this error : Error Could not connect to the database java.sql.SQLException: Io exception: Bad packet type
Any help ?