Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

problem with inet oracle driver

843859Aug 18 2005 — edited Aug 18 2005
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 15 2005
Added on Aug 18 2005
6 comments
587 views