Home » Developer & Programmer » JDeveloper, Java & XML » SQLException: Io exception: The Network Adapter could not establish the connection
SQLException: Io exception: The Network Adapter could not establish the connection [message #91074] Mon, 25 March 2002 06:05 Go to next message
aoife fallon
Messages: 1
Registered: March 2002
Junior Member
keep getting the following msg
SQLException: Io exception: The Network Adapter could not establish the connection
using jsp to connect to oracle below is my code

<%
Connection conn = null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");


conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:orcl", "username", "password");



Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM fionatest");
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #91080 is a reply to message #91074] Wed, 27 March 2002 02:36 Go to previous messageGo to next message
Christine
Messages: 18
Registered: March 2002
Junior Member
Hi!

This Error normally occures, if user, password or another part of getConnection(...) was wrong.
The second possibility I know, is that the server is down. But as you connect to localhost...

Good luck!
Christine
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #91152 is a reply to message #91074] Thu, 09 May 2002 22:17 Go to previous messageGo to next message
Seshaphani
Messages: 1
Registered: May 2002
Junior Member
i am getting the data from oracle database in jsp i get this message sir.
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #91193 is a reply to message #91074] Wed, 22 May 2002 06:57 Go to previous messageGo to next message
Min Zhao
Messages: 1
Registered: May 2002
Junior Member
I install Oracle database, weblogic in my computer, when I plus off the network cable, I got the problem "The Network Adapter could not establish the connection.", but after I plug in network cable, the jsp page works. could you please tell me how can I configure my computer so that I can work without network cable.
Thank you very much
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #91387 is a reply to message #91074] Mon, 05 August 2002 13:14 Go to previous messageGo to next message
Anonymous
Start the TNS listener
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #91815 is a reply to message #91074] Sun, 02 March 2003 22:42 Go to previous messageGo to next message
Jitendra Kumar Singh
Messages: 1
Registered: March 2003
Junior Member
Root Cause:
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)
at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:266)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.jsp.form_0005fuser$jsp._jspService(form_0005fuser$jsp.java:150)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:215)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2366)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1005)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1098)
at java.lang.Thread.run(Unknown Source)
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #92082 is a reply to message #91815] Tue, 02 March 2004 19:11 Go to previous messageGo to next message
sarath
Messages: 5
Registered: December 2000
Junior Member
Can you please quote the environment in which you got this error.

Is it some thing like.
tomcat (on Windows) accessing Oracle on linux/Solaris, etc or some thing like that.

Sarath.
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #92129 is a reply to message #92082] Sat, 20 March 2004 15:51 Go to previous messageGo to next message
Raj
Messages: 411
Registered: November 1998
Senior Member
HI,

Our team is also facing the same problem. We are running Tomcat on Windows and connecting to an Oracle instance which is running on Solaris env. If you have any thoughts on this issue then please email or post the info.

Thanks in advance.

Raj
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #92150 is a reply to message #92129] Thu, 25 March 2004 21:09 Go to previous messageGo to next message
Murali
Messages: 54
Registered: December 1999
Member
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

i got this message while connection oracle 9i. in windows 300 server. what was the problem? pls im sending that code also.
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn= DriverManager.getConnection ("jdbc:oracle:thin:scott/tiger@eltra:1521:eltra");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("Select * from emp");
while(rs.next())
{
System.out.println(rs.getString("ename"));
}
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #92248 is a reply to message #92150] Wed, 05 May 2004 05:17 Go to previous messageGo to next message
manohar
Messages: 15
Registered: October 2001
Junior Member
HI,
i'm getting the same problem, when i try to connect through a normal java program. Does any one have a solution for it!!???
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #92284 is a reply to message #92248] Tue, 18 May 2004 09:20 Go to previous messageGo to next message
Sam
Messages: 255
Registered: April 2000
Senior Member
This error message is recieved when all the open connections to the database are exhausted. So try closing the connection every time you open one. I think that should work !!!!
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #92289 is a reply to message #92284] Wed, 19 May 2004 05:12 Go to previous messageGo to next message
efan
Messages: 1
Registered: May 2004
Junior Member
I saw this message when I was connecting to Oracle 8.1.7 from IBM WSAD,the connection was unable to be created .
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #92293 is a reply to message #92289] Thu, 20 May 2004 00:15 Go to previous messageGo to next message
fiftybmg
Messages: 1
Registered: May 2004
Junior Member
I've got the same problem. Tried JDBC with jdk 1.3.1 and 1.4.2 against oracle 9i on Solaris from a Win box. Tried importing the classes12.zip for the 1.3.1 jdk, same problem. THe only thing I haven't tried is to install a working Oracle client on the same machine, but JDBC thin is not supposed to need it.

I would like to migrate to DB2 to stop wasting my time.

And I would appreciate if anyone has a fix for this. Thanks.
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #92369 is a reply to message #92248] Thu, 17 June 2004 10:16 Go to previous messageGo to next message
Jyothi
Messages: 12
Registered: May 2002
Junior Member
Hi,
Check the Database url,it shuold be like this

database url e.g. jdbc:oracle:thin@<IPAddressofDBserver>:1521:<SID>

if this is correct,check the listener,if it is started and listening on this port
if everything seems to be ok and still problem,try to restart your m/c and try again.

Regards
Jyothi.
Re: SQLException: Io exception: The Network Adapter could not establish the connection [message #92370 is a reply to message #92369] Thu, 17 June 2004 10:28 Go to previous messageGo to next message
Jyothi
Messages: 12
Registered: May 2002
Junior Member
Hi,
Check the Database url,it should be like this

database url e.g. jdbc:oracle:thin@IPAddressofDBserver:1521:SID

if this is correct,check the listener,if it is started and listening on this port
if everything seems to be ok and still problem,try to restart your m/c and try again.

Regards
jyothi.
SQLException: Io exception: The Network Adapter could not establish the connecti [message #92528 is a reply to message #91074] Wed, 01 September 2004 02:51 Go to previous messageGo to next message
Gan
Messages: 1
Registered: September 2004
Junior Member
hi,
I am also getting the same error... if u know this one means help me....

Thanxs...
Possible Answer - Re: SQLException: Io exception: The Network Adapter could not [message #92568 is a reply to message #91074] Sun, 19 September 2004 05:43 Go to previous messageGo to next message
Aaron Brady
Messages: 1
Registered: September 2004
Junior Member
After analysing the Net8 transmission between my Linux servlet container and Win2K Oracle instance, it appears that Net8 returns back the "canonical" address to use for the server, and tries to connect to that.

In my case, I am using an SSH tunnel to make 192.168.2.18:1521 appear as localhost:1521 - but Net8 is disconnecting and retrying the connection to 192.168.2.18, even though my JDBC URL only has 127.0.0.1 in it.

I don't actually have a solution to this problem, but I think this might frame it for someone smarter than me.
Re: SQLException: Io exception: The Network Adapter could not establish the conn [message #92631 is a reply to message #91074] Thu, 28 October 2004 07:58 Go to previous messageGo to next message
Mark Ireton
Messages: 1
Registered: October 2004
Junior Member
You need to make sure you have the right host name and SID. You can get this from your database administrator or from your TNSNAMES.ORA file.
Re: SQLException: Io exception: The Network Adapter could not establish the conn [message #92655 is a reply to message #92293] Mon, 08 November 2004 19:15 Go to previous messageGo to next message
nethra
Messages: 2
Registered: November 2004
Junior Member
yes. its a good idea.
Re: SQLException: Io exception: The Network Adapter could not establish the conn [message #92680 is a reply to message #91074] Sun, 21 November 2004 10:52 Go to previous messageGo to next message
lORINDA
Messages: 1
Registered: November 2004
Junior Member
I keep getting the following message when I try to setup my system instance in Oracle. Io exception: The Network Adapter could not establish the connection

If it is a matter of unlocking the database schema where do I go.
Re: SQLException: Io exception: The Network Adapter could not establish the conn [message #92763 is a reply to message #92655] Sun, 09 January 2005 15:37 Go to previous message
Jim Johansen
Messages: 1
Registered: January 2005
Junior Member
After looking long and hard I found that this can be resolved by starting the listener. See:

http://www.oracle.com/technology/obe/2day_dba/network/network.htm#t2

for more information and screen shots. I got the listener up and running and thus was able to get the database up and running. I did this with a command line entry by issuing the command:

$ lsnrctl start

You can check status by typing:

$ lsnrctl status

v/r
Jim
Previous Topic: cannot access class oracle.jdbc.driver.OracleDriver
Next Topic: Protocol Violation
Goto Forum:
  


Current Time: Thu Apr 25 13:07:48 CDT 2024