Error connecting to database - java.sql.SQLException: Io exception: The Net

Hello friends,
I know this question has been asked in a lot of other threads; but my problem is quite unique and that's why I'm starting a new thread...
When I try to access an Oracle 10g database through a Servlet code using a JDBC thin driver (both Tomcat and the database are running on Solaris 9), I get the following error:
"Error connecting to database - java.sql.SQLException: Io exception: The Network Adapter could not establish the connection"
However, there is another application running on the same server using the same database server (only the actual databases being used differ) and it is able to access the database without any issues. Both of these are absolutely similar applications and I couldn't think of any reasons why one would work and the other wouldn't. I thought they might be conflicting each other and tried running only the problematic application. But even then, I get the same error.
I know this might not be too relevant but to provide you some more information on the environment, the applications are running on separate Tomcat instances on the same server and they are connected to an Apache web server through Mod jk.
Any help in solving this problem is greatly appreciated!
Thanks!
Regards,
Yogaesh

Yogaesh wrote:
The 'application' that works is also a Tomcat application... It's exactly same as the problematic application in terms of the configuration and stuff... As for the typo errors, I copied the config info and pasted it... So pretty much it should be the same. And to add an additional note, I'm able to connect to the database from my localhost... I mean if I run the problematic application from localhost (without Apache and directly hitting Tomcat) I'm able to access the screens...
The second part of that (localhost) usually isn't all that useful. You know it is a connection failure so that means the code is running and technically successfully (since connection failure is a legitimate runtime error.)
You know it isn't a firewall issue because it connects from another app in tomcat. So it must be a configuration issue.
So something like one of the following.
1. It isn't the same (we already know this but this particular item means that it is not in fact exactly the same because you deliberately or accidently modified it.)
2. It isn't pulling the right config. Maybe you aren't packaging it, maybe it is buffered on the server and it is using that rather than what you think it is.
3. Java code is referring to the wrong name.
Do this, change the configuration so it points to a server that does not exist. Repack, redeploy. If the error is the same (no diff) then you know that it is not running the code that you think it is. If it does change then you know that it can only be 1.

Similar Messages

  • ERROR:DBCP borrowObject failed: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

    Does anyone know what this error means?I have already installed Analyzer 6.5 on Win NT, on locally installed Tomcat web server and the oracle 9i database is on a solaris box.I think the problem is it is not able to connect to the oracle repository but I don't know how to fix it. Thanks,Haroon

    Joe,
    It may happen during testOnReserve, too.
    Slava
    "Joseph Weinstein" <[email protected]> wrote in message
    news:[email protected]..
    That means the Oracle URL you supplied to the pool is incorrect forconnecting to the
    DBMS you want. If the same pool definition works sometimes and sometimesnot,
    then it's an oracle problem with rapid connection requests. Make the poolmake all it's
    connections at startup, by setting init=max, and this shouldn't happen.
    Joe
    Najib wrote:
    Hi,
    I am using a WebLogic Server 5.1. I created a connection pool to access
    Oracle DB 8.1.7. It works fine but some times i have this pb :
    Tue Apr 16 08:35:37 GMT 2002:<I> <JDBC Pool> Sleeping increateResource()
    SQLException Pool connect failed: weblogic.common.ResourceException:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: Io exception: The Network Adapter could notestablish the connection
    atoracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    atoracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    atoracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    atoracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:260)
    atoracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
    atoracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    atweblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Connection
    EnvFactory.java:164)
    atweblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Connection
    EnvFactory.java:123)
    can some one help me please.
    thinx.

  • DBCP borrowObject failed: java.sql.SQLException: Io exception: The Network

    My web application connection to Oracle is successful and displays proper output but sometimes i get this error and then i am not able to login to application.But again if I try logging in after sometime then there's no error and application works fine.
    Can anyone advice me on why only sometimes I get the error
    DBCP borrowObject failed: java.sql.SQLException: Io exception: The Network .I am using tomcat server and jdbc:oracle:thin driver for connect
    Thanks .
    Pallavi

    My web application connection to Oracle is successful
    and displays proper output but sometimes i get this
    error and then i am not able to login to
    application.But again if I try logging in after
    sometime then there's no error and application works
    fine.
    Can anyone advice me on why only sometimes I get the
    error
    DBCP borrowObject failed: java.sql.SQLException: Io
    exception: The Network .I am using tomcat server and
    jdbc:oracle:thin driver for connect
    Thanks .
    PallaviIt seems it has to do with the network not working properly; sometimes it works and sometimes just not. So DBCP sometimes can't get any connection to give you.
    You can probably configure dbcp (or Tomcat if you are using its built-in datasource) to retry until it can get a "good" connection, but for this you' ll have to look at dbcp or Tomcat docs (if you never heard of DBCP you it is probably useless to look in its docs, because probably Tomcat is responsible for its configuration).

  • [java.sql.SQLException: Io exception: The Network Adapter could not establish the connection]

    Hello,
    I have recently installed Weblogic6.1Sp1 server with Weblogic Intergration 2.1
    on solaris 7 and im getting this error when connecting to the database (oracle816.3);
    I have changed Oracle drivers and tried many different configurations, with no
    luck, Could someone give me some guidance or has anyone encounted this error before.
    Thanks
    Bobby
    java.sql.SQLException: Io exception: The Network Adapter could not establish the
    connection]
    java.sql.SQLException: Io exception: The Network Adapter could not establish the
    connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:260)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at com.bea.wlpi.rdbmsrealm.RDBMSDelegate.<init>(RDBMSDelegate.java:187)
    at com.bea.wlpi.rdbmsrealm.RDBMSDelegate$DFactory.newInstance(RDBMSDelegate.java:1177)
    at weblogic.security.utils.Pool.getInstance(Pool.java:57)
    at com.bea.wlpi.rdbmsrealm.RDBMSRealm.getDelegate(RDBMSRealm.java:104)
    at com.bea.wlpi.rdbmsrealm.RDBMSRealm.getUser(RDBMSRealm.java:145)
    at weblogic.security.acl.CachingRealm.getUserEntry(CachingRealm.java:806)
    at weblogic.security.acl.CachingRealm.getUser(CachingRealm.java:670)
    at weblogic.security.acl.internal.FileRealm.getPrincipalFromAnyRealm(FileRealm.java:1008)
    at weblogic.security.acl.internal.FileRealm.ensureRequiredObjectsExist(FileRealm.java:957)
    at weblogic.security.acl.internal.FileRealm.loadMembers(FileRealm.java:1202)
    at weblogic.security.SecurityService.initializeRealm(SecurityService.java:274)
    at weblogic.security.SecurityService.initialize(SecurityService.java:115)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:390)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:202)
    at weblogic.Server.main(Server.java:35)

    Hi. This is definitely an oracle-only problem, so you should simplify the problem
    down to a small standalone program using the oracle thin driver to make a connection.
    Once you get this to work, weblogic will also be able to do it. Make sure that
    when you try to have weblogic succeed after you can do it with oracle code only,
    that the driver you used to succeed with, is ahead of any weblogic jars in
    the server classpath. Note that we ship a classes12.zip in our packaging, but
    Oracle has since released a newer one (with the same name!) that has some bugs
    fixed. Make sure the later one is the one the JVM will pick up.
    Joe
    Bobby wrote:
    >
    Hello,
    I have recently installed Weblogic6.1Sp1 server with Weblogic Intergration 2.1
    on solaris 7 and im getting this error when connecting to the database (oracle816.3);
    I have changed Oracle drivers and tried many different configurations, with no
    luck, Could someone give me some guidance or has anyone encounted this error before.
    Thanks
    Bobby
    java.sql.SQLException: Io exception: The Network Adapter could not establish the
    connection]
    java.sql.SQLException: Io exception: The Network Adapter could not establish the
    connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:260)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at com.bea.wlpi.rdbmsrealm.RDBMSDelegate.<init>(RDBMSDelegate.java:187)
    at com.bea.wlpi.rdbmsrealm.RDBMSDelegate$DFactory.newInstance(RDBMSDelegate.java:1177)
    at weblogic.security.utils.Pool.getInstance(Pool.java:57)
    at com.bea.wlpi.rdbmsrealm.RDBMSRealm.getDelegate(RDBMSRealm.java:104)
    at com.bea.wlpi.rdbmsrealm.RDBMSRealm.getUser(RDBMSRealm.java:145)
    at weblogic.security.acl.CachingRealm.getUserEntry(CachingRealm.java:806)
    at weblogic.security.acl.CachingRealm.getUser(CachingRealm.java:670)
    at weblogic.security.acl.internal.FileRealm.getPrincipalFromAnyRealm(FileRealm.java:1008)
    at weblogic.security.acl.internal.FileRealm.ensureRequiredObjectsExist(FileRealm.java:957)
    at weblogic.security.acl.internal.FileRealm.loadMembers(FileRealm.java:1202)
    at weblogic.security.SecurityService.initializeRealm(SecurityService.java:274)
    at weblogic.security.SecurityService.initialize(SecurityService.java:115)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:390)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:202)
    at weblogic.Server.main(Server.java:35)

  • Java.sql.SQLException: Io exception: The Network Adapter could't establish connection

    Hi,
    I run java application on one Sun Solaris (5.8) server and call Oracle 8.1.6 MTS database on another Sun Solaris (5.8) server.
    When I am using jdbc:oracle:thin:@host:port:sid, I got:
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection.
    So, I changed to jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostip)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=databasename)(SERVER=DEDICATED))). It works.
    But, when I tested java application with jdbc:oracle:thin:@host:port:sid on other Sun Solaris 5.8 server, using same classes12.zip and connect to same MTS database, all of them worked.
    Right now, there is only one Sun server does not work with jdbc:oracle:thin:@host:port:sid format. And on this SUn server, using jdbc:oracle:thin:@host:port:sid format connect to other dedicated Oracle database is fine.
    Thanks for your help advance.
    Paul

    This is going to sound stupid, but have you made sure that the server that couldn't connect resolved the name of the database server correctly? We had some problems with some of our field offices not correctly resolving the IP address for our server when the name was given. I would first try and put the IP address for the server/host name:
    jdbc:oracle:thin:@1.1.1.1:port:sid
    That's just a thought, hope it works for you.

  • Java.sql.SQLException: Io exception: The Network Adapter could not establish the conn

    Hello all!
    First of all, I want to say I read all the answers to this problem that were posted in the past in this forum.
    I try to connect from the intranet to an Oracle database, named bc01. The string I use is "jdbc:oracle:thin:@192.168.199.11:1521:bc01". On the 192.168.199.11 machine the listener and oracleservice services are started. The bc01 is correctly added to tnsnames.ora. If I issue a tnsping80 192.168.199.11 from the console it works. However, if I issue the same command from my workstation, it doesn't work (says No listener). So what am I missing here?
    Any help is much appreciated !
    Thank you very much!

    Faizan,
    Normally this error is reported when the database is either not available or the URL is invalid. Please check the URL whether you have a valid DB connection there.
    Also I see the getConnection missing e,g.
    Connection conn = ds.getConnection();
    regards
    Debu
    I am trying to setup DataSource for my application and I am using oracle 8.1.6.3 database. I have following entry in the data-sources.xml file
    <data-source
                   class="oracle.jdbc.pool.OracleDataSource"
                   name="jdbc/pool/OracleDS"
                   location="jdbc/ConnectionDS"
                   pooled-location="jdbc/pool/OracleDS"
                   url="jdbc:oracle:thin:@machine:1521:development"
                   username="user"
                   password="password"
                   min-connections="3"
                   max-connections="50"
                   wait-timeout="10"               
                   inactivity-timeout="30"
         />
    In my JSP code I am doing following to access the database
    ResultSet sqlResultSet = null;
    PreparedStatement stm = null;
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource)ic.lookup("jdbc/OracleDS");
    stm = conn.prepareStatement(updtUser);
    I got following exception when I ran teh code
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    Thanks for help
    Faizan

  • Java.sql.SQLException: Io exception: The Network Adapter could not establish the

    Dear all,
    I have been trying to connect to Oracle 8 from Java but without success.
    I am using the following driver: oracle.jdbc.driver.OracleDriver
    and the thin protocol as follows:
    jdbc:oracle:thin:userid/password@databasename:1512:sid
    I am getting the error message:
    java.sql.SQLException: Io exception: The Network Adapter could not establish th
    connection
    I am using jdk1.3 with classes12.zip added to the classpath settings.
    Can anybody help please.
    Regards,
    [email protected] or [email protected]
    null

    Dear colleague,
    I am using a stand alone database running on my windows 98 laptop.
    I connect successfully via sql plus using the user id: scott and password tiger.
    Below is the entry of my tnsname.ora:
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    I am finding difficult to specify a host, but I have tried the following combinations:
    DriverManager.getConnection ("jdbc:oracle:thin:@koudry:1521:PLSExtProc","scott", "tiger");
    where the machine name is koudry and PLSExtProc the sid.
    DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:PLSExtProc","scott", "tiger");
    and also 127.0.0.1 which is the ip address of the localhost. All these give me the following error:
    Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap
    ter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:263)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va: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 web.main(web.java:10)
    When I use the oci protocol like:
    DriverManager.getConnection ("jdbc:oracle:oci8:@127.0.0.1:1521:PLSExtProc","scott", "tiger");
    I get the following error:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: make_c_state
    at oracle.jdbc.oci8.OCIDBAccess.make_c_state(Native Method)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:233)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:249)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(DriverManager.java:517)
    at java.sql.DriverManager.getConnection(DriverManager.java:177)
    at web.main(web.java:10)
    Below is the entry for autoexec.bat:
    set classpath=.;c:\oracle\ora81\jdbc\lib\classes12.zip;
    mode con codepage prepare=((850) C:\WINDOWS\COMMAND\ega.cpi)
    mode con codepage select=850
    keyb uk,,C:\WINDOWS\COMMAND\keyboard.sys
    SET Path=c:\Oracle\Ora81\lib;c:\Oracle\Ora81\bin;"C:\PROGRAM FILES\ORACLE\JRE\1.1.7\BIN";C:\WINDOWS;C:\WINDOWS\COMMAND;C:\;C:\DOS;C:\JDK1.3\BIN;C:\MSSQL7\BINN;C:\JDK1.3\SRC;
    Can anyone see what I am doing wrong.
    Thanks,
    Richard Koudry
    null

  • Java.sql.SQLException: Io exception: The Network Adapter could not establish the co

    I am using Oracle 9i Server just the
    Weblogic 5.1 and also using Oracle 8.1.6 client for weblogic. When I start the weblogic application I am getting the following error message
    "java.sql.SQLException: Io exception: The Network Adapter could not establish the co
    nnection

    On 10 Feb 2003 09:51:52 -0800, Shankar Viswanathan
    <[email protected]> wrote:
    I am using Oracle 9i Server just the
    Weblogic 5.1 and also using Oracle 8.1.6 client for weblogic. When I start the weblogic application I am getting the following error message
    "java.sql.SQLException: Io exception: The Network Adapter could not establish the co
    nnection
    "You're not providing a lot of information here, but I'll assume a few
    things and say...
    Ensure the URL param is set properly in the pool def. Check hostname,
    port and database/TNS entry. Also, try dbpinging the database with the
    following:
    java utils.dbping ORACLE <user> <password> <dbname>
    substitute the appropriate values where necessary. For example, I have
    a TNS def called 'jforum.world' for a particular oracle instance. User
    is 'auser' and the password is 'apass'. The following command will
    test the connection:
    java utils.dbping ORACLE auser apass jforum.world
    Alternatively, you can try tnsping, an oracle util, to test the
    connectability.
    If either of these utils work, then it's probably a typo somewhere in
    the pool properties.
    Bon

  • Java.sql.SQLException: Io exception: The Network Adapter could .....

    actually I changed the hostname for plesk. when I restarted the server then error appears:
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    thanks & best regards

    1) What is "plesk"?
    2) java.sql.SQLException implies that you have a Java application using JDBC to connect to the database. That would seem to imply that this has nothing to do with ODBC.
    3) When the JDBC driver raises this error, there should be additional information about what particular Oracle error was raised. Do you have that information?
    4) Can you connect to the database using a different application? Like SQL*Plus, for example?
    5) Taking a wild guess, I'd tend to suspect that you would need to change the host name configured for the client's connection string. That might be in your tnsnames.ora file, it might be in a n application config file, it might be in an application dialog, or that information may have been embedded into the application.
    Justin

  • Localhost linux java.sql.SQLException: Io exception: The Network Adapter co

    I recently upgraded from Redhat 9 to Fedora Core 4, and am running an Oracle 9i on this machine.
    Since this upgrade, I'm unable to connect from the machine itself to the db, using the JDBC thin driver. This worked on Redhat 9.
    I'm also able to connect from any other machine to this db with the JDBC driver.
    Also, any ping, tnsping, sqlplus work from localhost and other machines.
    Only the JDBC connection from the localhost itself fails, with following exception:
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at Jdbctest.main(Jdbctest.java:97)
    *** SQLException caught ***
    SQLState: null
    Message: Io exception: The Network Adapter could not establish the connection
    Error Code: 17002
    In following URL - jdbc:oracle:thin:@myserver:1521:mydb - I tried 'localhost', '127.0.0.1', 'dns name', 'ip address', but all fail.
    Any ideas would be highly appreciated (I'm searching for days now...)
    Thanks in advance,
    Tim

    EtherrealTake this with a grain of salt; I know a lot of the theory but don't have much hands on experience...
    Not a bad idea, but you need to understand more if it's going to work (it might not). Etherreal and most other sniffers work by capturing traffic at the network interface (NIC) level, this allows the NIC to be switched into "promiscuous" mode and capture all the network traffic "on the wire" in that network segment, even traffic destined for other machines.
    You can think of "networking" as an onion, or a stack of layers (see "OSI 7 laye model", Google or http://www.webopedia.com/quick_ref/OSI_Layers.asp for one theoretical approach), and etherreal works at pretty "outside" ot "low" level; the "internal" traffic that your interested in seeing either never gets to the level that Etherreal is monitoring, or is doing so in an area that is parallel to the one you're monitoring.
    It's possible that you might be able to configure etherreal to see the "loopback" traffic. I suspect that somewhere, you can specify which network interface is to be monitored, and you can change it to monitor the "local" network interface. If your Linux setup is typical, etherreal is probably monitoring interface "eth0" and you probably want to monitor "lo" to see local traffic.
    You can find out what interfaces you have with the command:
    ifconfig -a
    On the Red Hat Entrerprise that I have, that command is not in the default PATH, but is in /sbin; on other flavors of Unix I know it is found in /usr/sbin
    If you can get etherreal monitoring the local interface, you should be able to see the traffic generated by "ping 127.0.0.1"
    BTW, that command will also give you raw counts of the number of packets on all interfaces; if you have the machine to yourself, you might try a connection attempt and see which (if any) interfaces have packet numbers increase; if none do, then the connection attempt is failing before it gets to the packet level and Etherreal won't tell you anything.

  • SEVERE: java.sql.SQLException: Io exception: The Network Adapter could not

    Hi Friends,
    I am installing Java Addin to ECC 6.0 SR3 on Solaris 5.10(Oracle 10.2).
    SCS Addin i have completed.Right now i am facing issue when installing DB Addin Java in phase -->
    Java Import--->
    08.01.09 00:23:39 com.sap.inst.jload.Jload logStackTrace
    SEVERE: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    I have captured this error in jload.log
    As per SAP Note 969660 i have restarted the Listener but still no luck..
    Could any one aware of this issue.
    Thanks
    Siva
    9885704611

    Hai,
    Check the below links, may be helpful.....
    http://www.websina.com/bugzero/kb/oracle-connection.html
    /thread/498275 [original link is broken]
    Regards,
    Yoganand.V

  • Tion in thread "main" java.sql.SQLException: Io exception: The Network Adap

    I know this has been posted repeatedly. However, I have tried all the generic solutions Mine is a little different.
    1. I can connect with SQLPLUS to the database. I am on windows XP connecting to Oracle 10g on a Solaris box. So the listener is running.
    2. Here is my tnsnames.ora entry which works with SQLPLUS:
    I can tnsping this address
    SID_NAME =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = IP_NUMBER)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = SID_NAME)
      )I am trying to run the following sample code:
    * This sample shows how to list all the names from the EMP table
    * It uses the JDBC THIN driver.  See the same program in the
    * oci8 samples directory to see how to use the other drivers.
    package basic;
    // You need to import the java.sql package to use JDBC
    import java.sql.*;
    class Employee
      public static void main (String args [])
           throws SQLException
        // Load the Oracle JDBC driver
        DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
        // Connect to the database
        // You must put a database name after the @ sign in the connection URL.
        // You can use either the fully specified SQL*net syntax or a short cut
        // syntax as <host>:<port>:<sid>.  The example uses the short cut syntax.
        String url = "jdbc:oracle:thin:@IP_NAME:1521:SID_NAME";
        String userName = "USERNAME";
        String password = "PASSWORD";
        if (args.length > 0) url = args[0];
        if (args.length > 1) userName = args[1];
        if (args.length > 2) password = args[2];
        //Connection conn =
        //  DriverManager.getConnection (url, userName, password);
    Connection conn =
        DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=IP_NUMBER:1521)(PORT=1521)))(CONNECT_DATA=(SID=SID_NAME)(SERVER=DEDICATED)))", "USERNAME", "PASSWORD");
        // Create a Statement
        Statement stmt = conn.createStatement ();
        // Select the ENAME column from the EMP table
        ResultSet rset = stmt.executeQuery ("select object_name from user_objects");
        // Iterate through the result and print the employee names
        while (rset.next ())
          System.out.println (rset.getString (1));
    }I also used the following IP
    Connection conn =
          DriverManager.getConnection (url, userName, password);

    Replace the url with
    String url = "jdbc:oracle:thin:@IP_NUMBER:1521:SID_NAME";

  • Java.sql.SQLException: Io exception: The Network Adapter could not stablish

    I would really happy if someone can help me out about subjected matter
    Following is description
    O/S : WinXP (Server pack 2)
    When I am connected to internet it is working fine. But without internet it is not connecting to database. In "transname.ora" My server = DEDICATED. PROTOCOL = TCP, PORT = 1521
    Another problem is when I am changing HOST name from my computer name to 127.0.0.1, it is giving same problem even though it is connected to internet.

    Thanks for your reply.
    When I am using 127.0.0.1, it is not connecting to database. I tried both way, by connecting internet and without connecting internet.
    But when I am using computer name, database is connecting only when I am at internet.
    1) Exact host name is retechome
    2) when I running ipconfig while computer is connected to internet its giving :
    Connection-specific DNS Suffix .....: gateway.2wire.net
    IP Address...........................................: 192.168.1.68
    Subnet Mask........................................: 255.255.255.0
    Dafult Gateway.....................................: 192.168.1.256
    3) When disconnected from the internet, its giving following msg:
    Ethernet adapter Local Area Connection:
    Media State.................................: Media disconnected
    Just for your information, I tried to use ping when computer is not connected to internet using ping 127.0.0.1 and ping retechome and both sucessfully sent = 4, Received =4, Lost =0 (0% loss)
    I would really apreciate your help.
    Thanks

  • SQLException java.sql.SQLException: Io exception: The Network Adapter could

    I get the following error when I try to run a servlet that has
    a JNDI data source connection.
    http://localhost:8988/context-root/servlet/ServletExample
    Servlet Code
    InitialContext myInitialContext = new InitialContext();
    DataSource myDataSource = (DataSource)
    (myInitialContext.lookup("jdbc/OracleCoreDS"));
    // connect to the database using the data source
    myConnection = myDataSource.getConnection();
    // myConnection = getConnection(); STATIC JDBC METHOD BELOW
    I have modeified j2ee/home/config/data-sources.xml to
         <data-source
              class="com.evermind.sql.DriverManagerDataSource"
              name="OracleDS"
              location="jdbc/OracleCoreDS"
              xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="scott"
              password="tiger"
              url="jdbc:oracle:thin:@bomber:1521:lynx"
              inactivity-timeout="30"
         />
    When I use the following JDBC connection method everything works fine.
    public static Connection getConnection() throws SQLException
    String username = "scott";
    String password = "tiger";
    String thinConn = "jdbc:oracle:thin:@bomber:1521:lynx";
    Driver d = new OracleDriver();
    Connection conn = DriverManager.getConnection(thinConn,username,password);
    conn.setAutoCommit(false);
    return conn;
    Can somebody help?????

    Obtain datasource with:
    DataSource myDataSource = (DataSource)
        myInitialContext.lookup("java:comp/env/jdbc/OracleCoreDS");instead of:
    DataSource myDataSource = (DataSource)
    (myInitialContext.lookup("jdbc/OracleCoreDS"));

  • Java.sql.SQLException: Io exception: The Network Adapter could not establis

    hi i am getting this error when after saving the query in query builder

    Check if the listener has been started in Database server host machine. First try connecting using SQL Plus and then try the program.
    On the db machine, add ORACLE_HOME/bin to PATH and try this cmd
    lsnrctl status-- will show if the listener is running or not, also verify if the port is '1521', else change the port in jdbc url to port specified in this o/p
    lsnrctl start -- will start the listener
    HTH

Maybe you are looking for

  • While posting the Doc thru GM_CREATE_BUDGET taking to short dump

    while posting the Doc thru GM_CREATE_BUDGET taking to short dump giving the message:- Runtime Errors         MESSAGE_TYPE_X Error analysis     Short text of error message:     System error during characteristic derivation maintenance     Long text of

  • Shared Review error w/Pro 9

    Hi, we're using a PC for shared reviews on a WebDav server. Acrobat Pro 9 creates a folder on the server but the PDF does not get posted. Same result w/ network server reviews. No problems posting from a Mac using Acrobat 8 to same servers. Anyone el

  • HT3211 Should we press to click on something in macbook pro ? Mine is not touch for clicking !!

    Should we press to click on something in macbook pro ? Mine is not touch for clicking !! I mean i must push the trackpad to click but for other functions it is touch and it doesnt need to be pushed ! Is it broken ?

  • Need a help to create user and assign BP to it

    Hi, I have requirement to create Users (like SU01) in CRM and for that users need to create BP with role EMPLOYEE and assign BP to that USER. Can anybody please help on which Function Module I need to use to create user and assign BP to it. Thanks in

  • Using of abap predifined screens in views

    Hi, I tried to insert abap screens( predifined  and designed me) in webdynpro abap views but these screens are not visible after insertion complete but context part visible as per screen elements, if i try to save got message like 'MAIN was not chang