Hi,
I am using inet oracle jdbc type 4 driver (Oranxo.jar) to connect to oracle 9i server. The connection's working fine. Now, I am trying to run a program which uses datasource. It compiles with no error.
But, when I run th program: I get a runtime exception which is:
java.lang.ClassCastException
at CreateMovieTables1.initialize(CreateMovieTables1.java:57)
at CreateMovieTables1.main(CreateMovieTables1.java:143)
com.inet.ora.SQLException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.<init>(Socket.java:309)
at java.net.Socket.<init>(Socket.java:124)
at com.inet.ora.OraDriver.connect(Unknown Source)
at com.inet.ora.OraDataSource.getConnection(Unknown Source)
at CreateMovieTables1.initialize(CreateMovieTables1.java:61)
at CreateMovieTables1.main(CreateMovieTables1.java:143)
This is the line in the code I am getting an error:
try
{
ods = (com.inet.ora.OraDataSource) c.lookup("jdbc/oracle");
} catch(Exception e) {
e.printStackTrace();
}
help!!
Regards,
shipf1