I am using netbeans and jdk 7 updt 9 with 1.7 and following is my code.

```
public class jd {
    public static void main(String[] args) throws ClassNotFoundException, SQLException 
{

        Class.forName("oracle.jdbc.driver.OracleDriver");
        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1158:ORCL","system", "system");
        System.out.println("Connection successful");
       // Statement s = con.createStatement();

    }

}

```

output is

```
 run:
    Exception in thread "main" java.sql.SQLRecoverableException: IO Error: Got minus one from a read call
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:673)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:715)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:385)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:30)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:564)
        at java.sql.DriverManager.getConnection(DriverManager.java:571)
        at java.sql.DriverManager.getConnection(DriverManager.java:215)
        at jd.main(jd.java:22)
    Caused by: oracle.net.ns.NetException: Got minus one from a read call
        at oracle.net.ns.Packet.receive(Packet.java:314)
        at oracle.net.ns.NSProtocolStream.negotiateConnection(NSProtocolStream.java:153)
        at oracle.net.ns.NSProtocol.connect(NSProtocol.java:263)
        at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1360)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:486)
        ... 7 more

Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

```