aspose file tools*
The moose likes JDBC and the fly likes oracle does not listens on TCP/IP port Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "oracle does not listens on TCP/IP port" Watch "oracle does not listens on TCP/IP port" New topic
Author

oracle does not listens on TCP/IP port

shahzad
Greenhorn

Joined: Jul 31, 2001
Posts: 7
hi
I was trying to connect to oracle Database using type 4 thin drivers on win98.
I downloaded the driver from oracle site and also downloaded some more drivers
from other sites.While connecting to data base I ran into problems I am working
for about two days on this thing but couldn't succeed.

I get the following message:
Connection refused ...........

The driver is succefully loaded but when it tries to connect using

conn = DriverManager.getConnection("jdbc racle:thin:@server:1521 rcl","userid","password");
it gives the above message.

now I think that I am giving the host name incorrect I couldn't find
any way in oracle to figure out the host name.

I am giving
"jdbc racle:thin:@127.0.0.1:1521 rcl"
I have also tried other options for host name like localhost etc.but it
didn't resolve.I think that the listener for oracle is not listening at the port 1521.
I tried telnet to check that but it failed to connect at this port.I tried to do this
with mysql to connect at port 3306 using telnet it succeeded.

Second thing is that I tried to create a service name in oracle using TCP/IP protocol
giving the above mentioned host names at all the attempts it gave the error that it has performed
an illegal operation .
I think that there are some settings needed for oracle to listen at this port which
I dont know or I am giving the host name wrong . I shall be extremely thankful if u help
me to solve this problem.
Regards
shAhzad
Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
try restart oracle service or check proxy


Senior software engineer
Kareem Gad
Ranch Hand

Joined: Aug 06, 2001
Posts: 89
Dorj,
Seems that you've tried everything. Nope , there's one thing u could do to be sure that the listener is currently listening:
go to the command prompt and type :
lsnrctl
or
lsnrctl80
which ever one that will work.
after that type in :
start
then type:
quit
then try your code.
------------------
KaReEm
[This message has been edited by Kareem Gad (edited August 06, 2001).]


<b><i>KaReEm</i><br /><ul type="square"><li>SCJP-Free Range Web Developer <br /></ul></b>
shahzad
Greenhorn

Joined: Jul 31, 2001
Posts: 7
I have alredy tried that i have even reinstalled oracle. I Think that oracle works perfectly with win98 or win2k.Thanx
for your answer.
DAYANAND BURAMSHETTY
Ranch Hand

Joined: Aug 06, 2001
Posts: 34
Write this one
(jdbc racle:thin:@127.0.0.1:1521 rcl",props);
// this is Connection function
public Connection getConnection() throws SQLException
{
try{
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
} catch (ClassNotFoundException cnfe) {
throw new SQLException(cnfe.getMessage());
} catch (IllegalAccessException iae) {
throw new SQLException(iae.getMessage());
} catch (InstantiationException ie) {
throw new SQLException(ie.getMessage());
}
System.out.println("OracleDriver loaded Successfully....\n");
Connection con = null;
Properties props = new Properties();
props.put("user","scott");
props.put("password","tiger");
try {
con = DriverManager.getConnection("jdbc racle:thin:@127.0.0.1:1521 rcl",props);
return con;
} catch (Exception e) {
System.out.println("Exception :::"+e.getMessage());
throw new SQLException (e.getMessage());
}
}


Dil se....,<BR>Dayanand<BR>0065-8839071(off)<BR>0065-7547034(Res0
shahzad
Greenhorn

Joined: Jul 31, 2001
Posts: 7
I have tried that code but the problem is that the code is perfectly alright driver is also perfect but the problem is with
the data base it is not listening on the port 1521. I have tried
to connect with it at host 127.0.0.1 at port 1521 using telnet
but it gives a window error message . On the other hand i tried
to connect with mysql at port 3306 using localhost it succeeded.
My idea is that the oracle supports such an activity
on winnt or win2k.Thanx for ur help.
shahzad
Greenhorn

Joined: Jul 31, 2001
Posts: 7
I have tried that code but the problem is that the code is perfectly alright driver is also perfect but the problem is with
the data base it is not listening on the port 1521. I have tried
to connect with it at host 127.0.0.1 at port 1521 using telnet
but it gives a window error message . On the other hand i tried
to connect with mysql at port 3306 using localhost it succeeded.
My idea is that the oracle supports such an activity
on winnt or win2k.Thanx for ur help.
 
Consider Paul's rocket mass heater.
 
subject: oracle does not listens on TCP/IP port
 
Similar Threads
oracle doenot listen on TCP/IP port
Access to the Oracle database using Java Applets
Dynamic IP address for thin driver
JDBC ODBC host string
Unable to connect to oracle usin type 4 thin