SQl Exception while connecting to Oracle Databse : Network adaptar .......

hi !
I am geeting an SQL Exception ...
Network apdator could not establish connection..
the code is as follows
String driverName = "oracle.jdbc.driver.OracleDriver";
String dbURL = "jdbc:oracle:thin:@server:1521:biz";
String uName = "uidt";
String pwd = "pwd";
Class.forName(driverName);
conn = DriverManager.getConnection(dbURL, uName, pwd);
Please help me out !!

First aid check list for "connection refused":
- Check host name in connect string.
- Check port number in connect string.
- Try numeric IP address of server host in connect string, in case name server is hosed.
- Are there any firewalls between client and server blocking the port.
- Check that the db server is running.
- Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port.
- Try "telnet serverhost the-port-number" from the client, to see if firewalls are blocking it.
- If "telnet" fails: try it with the numeric ip address.
- If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
- Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

Similar Messages

  • Sql exception when connecting to oracle database

    When trying to connect to an oracle database using the code below i get an sql error. i put the code below it and the stack trace below the code. any help would be great
    Connection connection = null;
            try {
                // Load the JDBC driver
                String driverName = "oracle.jdbc.driver.OracleDriver";
                Class.forName(driverName);
                //  Create a connection to the database
                String serverName = "192.168.0.2";
                String portNumber = "1158";
                String sid = "orcl";
                String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
                // String url = "jdbc:oracle:oci:@orcl";
                String username = "system";
                String password = "mmsi";
                connection = DriverManager.getConnection(url, username, password);
            } catch (ClassNotFoundException e) {
                System.out.println("Class Not Found Exception in connection to db");
            } catch (SQLException e) {
                System.out.println("SQL Exception in connecting to Database ");
                e.printStackTrace();
    stackTrace------------------------------------------------------------------------------
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    SQL Exception in connecting to Database
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
            at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
    before this.start
    got to doaction
            at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:420)
            at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
            at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
            at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
            at java.sql.DriverManager.getConnection(DriverManager.java:525)
            at java.sql.DriverManager.getConnection(DriverManager.java:171)
            at mmsiserver.conversation.<init>(conversation.java:190)
            at mmsiserver.Server.run(Server.java:105)
    Exception in thread "Thread-0" java.lang.NullPointerException
            at mmsiserver.conversation.doAction(conversation.java:218)
            at mmsiserver.conversation.<init>(conversation.java:202)
            at mmsiserver.Server.run(Server.java:105)Message was edited by:
    pcpitcher1

    Please read this
    http://forum.java.sun.com/thread.jspa?threadID=512566&start=0&tstart=0

  • Problem in sql developer while connecting to oracle 11g

    when am creating a database connection with oracle 11g in sql developer editor it s throwing network adapter could not establish the connection
    connection name test
    user name system
    password system
    Role default
    Host name localhost
    Port 1521
    SID orcl
    Can any one help me to resolve the problem?
    Thanks in advance

    Those parameters probably aren't correct.
    Is that 11g on your machine? Try to specify the real IP instead. And sure the listener is up?
    Also sure about the SID and port?
    Hope that helps,
    K.

  • SQL Exception while connecting MS SQL DB from Weblogic - URGENT

    We are getting lot of errors like this in our server logs.
    Let us know how to resolve these errors.
    <Dec 11, 2013 3:05:01 AM EST> <Error> <Lease> <BEA-403302> <An unexpected SQL exception occured java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Violation of PRIMARY KEY constraint 'PK_LEASE'. Cannot insert duplicate key in object 'dbo.P13N_LEASE'. The duplicate key value is (JobManagerImpl)..
    java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Violation of PRIMARY KEY constraint 'PK_LEASE'. Cannot insert duplicate key in object 'dbo.P13N_LEASE'. The duplicate key value is (JobManagerImpl).

    Hello,
    WLP Version ?
    Emmanuel

  • SQL Exception while connecting to Jtds driver

    hi...can somebody help me with my error
    iam using "net.sourceforge.jtds.jdbc.Driver" with SQL Server 2000 on XP with tomcat version 4.0
    it gives me the following exception
    java.sql.SQLException: "Network error IOException: Connection refused: connect"
    can somebody help me urgent

    ya i tried telnet localhost 1433..still
    Connecting To localhost...Could not open connection to the host, on port 1433: Connect failed
    and when i use netstat -an the foll appears
    Active Connections
    Proto Local Address Foreign Address State
    TCP 0.0.0.0:25 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:443 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:1027 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:5101 0.0.0.0:0 LISTENING
    TCP 127.0.0.1:1033 0.0.0.0:0 LISTENING
    TCP 192.168.1.2:139 0.0.0.0:0 LISTENING
    TCP 192.168.1.2:1138 216.155.193.140:5050 ESTABLISHED
    TCP 192.168.1.2:1151 68.142.233.167:443 ESTABLISHED
    TCP 192.168.1.2:1422 61.2.36.53:5101 ESTABLISHED
    TCP 192.168.1.2:1593 59.92.38.133:5101 ESTABLISHED
    TCP 192.168.1.2:1874 216.109.118.146:5001 ESTABLISHED
    TCP 192.168.1.2:2054 64.94.235.124:80 ESTABLISHED

  • Error While Connecting to Oracle

    Hi All,
    While Connecting to Oracle through jdbc thin driver, following error is displayed. Please help me in resolving the same.
    <b>SQL Exception:
    State  : null
    Message: Io exception: The Network Adapter could not establish the connection
    Error  : 17002</b>

    hi,
    Any or all of the following conditions may also apply:
    1) You are able to establish a SQL*Plus connection from the same client to the same Oracle instance.
    2) You are able to establish a JDBC OCI connection, but not a Thin
       connection from the same client to the same Oracle instance.
    3) The same JDBC application is able to connect from a different
       client to the same Oracle instance.
    4) The same behavior applies whether the initial JDBC connection
       string specifies a hostname or an IP address.
    Go thru the foll url
    http://www.websina.com/bugzero/kb/oracle-connection.html
    wbr,
    KK

  • Exception while connecting to Content  server from JDeveloper

    I am getting following exception while connecting from jDeveloper
    java.lang.NullPointerException
         at oracle.stellent.wcm.jdev.shared.connection.ConnectionContext.<init>(ConnectionContext.java:53)
         at oracle.stellent.wcm.jdev.features.rescat.IdcConnectionPanel.testAndLogin(IdcConnectionPanel.java:344)
         at oracle.stellent.wcm.jdev.features.rescat.IdcConnectionPanel.access$000(IdcConnectionPanel.java:75)
         at oracle.stellent.wcm.jdev.features.rescat.IdcConnectionPanel$1.doInBackground(IdcConnectionPanel.java:505)
         at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
         at javax.swing.SwingWorker.run(SwingWorker.java:316)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
         at java.lang.Thread.run(Thread.java:662)
    please Help
    ~Hari

    Ok. I found out why it is happening.
    If I follow the section 3.1.2 and setup the site studio connection then everything is fine
    3.1.2 Creating a Content Server Connection
    http://download.oracle.com/docs/cd/E17904_01/doc.1111/e13650/ssxa_creatingsites.htm#CIHJGHFC
    If I try to create a content server connection from file->new->content server connection then I get a null pointer exception.
    I am sure someone from Oracle will fix it soon. For now all is well with Site Studio.

  • JDBC SQL Exception while updating an SQL database

    Hi Experts,
    Recently i have encountered a JDBC SQL exception while updating aSQL database as below,
    com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SAP_UPLOAD' (structure 'Statement'): java.sql.SQLException: No more data to read from socket
    the above system error didn't occur for all messages (so far happened twice), but i need to find an fix to overcome this system error.
    did anybody came across the above system error, please help me to resolve.
    Thanks

    Hi bandana,
    From SAP Note --> 831162
    17. Receiver: java.sql.SQLException During First Message Processing
    Q: When sending a message to a JDBC receiver channel for the first time after an extended inactivity period, I am observing a java.sql.SQLException in the adapter's processing, which refers to a closed connection or a timeout? What is causing this and how do I work around this problem?
    A: The database server has apparently closed the adapter's JDBC connection from the server side. Nevertheless, the message should be processed successfully during the next retry. If you want to completely eliminate the symptoms, enable the setting "Advanced Mode" -> "Disconnect from database after each message processing". Note that this might have a negative performance impact for high-volume processing.
    I would recommend you to go through the complete note !!! Very Informative .
    Regards,

  • Which version of SQL*Plus can connect to Oracle 8i Database?

    Which version of SQL*Plus can connect to Oracle 8i Database?
    I would like to know which version of SQL*Plus can connect to Oracle 8i Database?
    Where can I download it?
    (I have tried SQL*Plus version 11 and the program said it does not support the connection to Oracle 8i Database)
    Thank you very much!

    By the way, what's your 8i database release version
    SQL> select * from v$version;
    Any SQL*Plus of 8i can connect to 8i Database.
    Only SQL*Plus of 9.0.1 can connect to 8.1.7 and 8.1.6 Database
    Only SQL*Plus of 10.1.0/10.2.0 can connect to 8.1.7 Database
    Absolutely NO SQL*Plus of 11g can connect 8i databases
    Regards,
    Sabdar Syed,

  • Can't get any mail while connected on a wifi network

    Hi All!
    Just upgraded my first gen iPhone with the 2.0 software update.... Absolutely loving it... but it seems that I can't get any mail from my google imap account while connected on a wifi network.... no problems if I'm using the edge network.
    Any ideas?
    Thanks for reading.
    cheers

    Hi Nathan, Thanks for the reply.
    I'm using my macbook's airport to share the internet via the ethernet port.
    Not sure what u mean by 993.
    cheers.

  • Getting Exception while connecting to oim

    Getting Exception while connecting to oim
    log4j:WARN No appenders could be found for logger (XELLERATE.JBOSSLOGINHANDLER).
    log4j:WARN Please initialize the log4j system properly.
    Exception in thread "main" java.lang.NoSuchFieldError: TRACE
         at org.jboss.logging.Log4jLoggerPlugin.isTraceEnabled(Log4jLoggerPlugin.java:85)
         at org.jboss.logging.Logger.isTraceEnabled(Logger.java:122)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:660)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.thortech.xl.ejb.interfaces.tcUnauthenticatedOperationsUtil.lookupHome(Unknown Source)
         at com.thortech.xl.ejb.interfaces.tcUnauthenticatedOperationsUtil.getHome(Unknown Source)
         at Thor.API.Security.ClientLoginUtility.getUnauthenticatedOperations(Unknown Source)
         at Thor.API.Security.ClientLoginUtility.login(Unknown Source)
         at Thor.API.tcUtilityFactory.<init>(Unknown Source)
         at SearchUser.Connect(SearchUser.java:101)
         at SearchUser.main(SearchUser.java:215)
    Process exited with exit code 1.
    I have added configuration file path also i copied log4j file to xlClient from JBOSS_HOME/server/default but still i am getting this exception.

    The new log4j JAR file has to be named exactly the same way the previous one was named (log4j-1.2.8.jar I think).

  • Error while connecting to Oracle in Linux

    I wrote a JAVA program to test the connection with Oracle. It worked in NT environment, but it did not in Linux Environment. I got the error message: "IO exception: The Network Adapter could not establish the connection."
    Here is JAVA code:
    import java.sql.*;
    class Employee1
    public static void main (String args [])
    throws SQLException
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn =
    DriverManager.getConnection ("jdbc:oracle:thin:@203.149.143.1:1521:ora1",
    "dxhub", "manager");
    Statement stmt = conn.createStatement ();
    ResultSet rset = stmt.executeQuery ("select user_id from user_info");
    while (rset.next ())
    System.out.println (rset.getString ("user_id"));
    catch(Exception e)
    System.out.println(e.getMessage());
    I think there is nothing wrong with JAVA code. There must be something wrong in the Linux environment. I appreciate your help if someone can give me a little advice.
    Tony
    null

    I wrote a JAVA program to test the connection with
    Oracle. It worked in NT environment, but it did not
    in Linux Environment. I got the error message: "IO
    exception: The Network Adapter could not establish
    the connection."
    Here is JAVA code:
    import java.sql.*;
    class Employee1
    public static void main (String args [])
    throws SQLException
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn =
    DriverManager.getConnection
    n ("jdbc:oracle:thin:@203.149.143.1:1521:ora1",
    "dxhub", "manager");
    Statement stmt = conn.createStatement ();
    ResultSet rset = stmt.executeQuery ("select user_id
    d from user_info");
    while (rset.next ())
    System.out.println (rset.getString ("user_id"));
    catch(Exception e)
    System.out.println(e.getMessage());
    I think there is nothing wrong with JAVA code. There
    must be something wrong in the Linux environment. I
    appreciate your help if someone can give me a little
    advice.
    Tony
    nullDid you ever find an answer to this, I'm having the same problem. My application works under windows, but doesn't under linux.
    Lonnie

  • SQL Developer not Connecting to Oracle after Updating java

    Hi,
    I am using Oracle 11gR1. Windows XPsp2 OS. Earlier Sql Developer was connecting successfully to Oracle , but when i updated my java Runtime to 'Update 17' (Of version 6), I am getting problem...Something like vendor problem error(tried to connect many times, also restarted system...but same problem persisted).
    BUT, at this time when i am writing this problem, I though to check again that problem and get that actual error message....but surprisingly now that error is resolved automatically as if something magic has happened...
    I am continuously connected to internet for last 5 hours.
    SO, WHAT WAS THE PROBLEM , AND HOW IT IS RESOLVED AUTOMATICALLY?

    Hi ,
    once again the same problem. Again i am not able to connect to Sql Developer environment. My JRE is updated to update 18, since then again i am facing the same problem.what could be the possible solution?
    The exact error message is "An error was encountered performing the request operation:Io exception:The network Adapter could not establish the connection vendor code 17002"
    Thanks
    Edited by: user12222356 on Apr 2, 2010 5:39 AM
    Edited by: user12222356 on Apr 2, 2010 5:42 AM

  • Problem while Connecting with oracle thin driver

    I have been trying for the past two days for connecting oracle 8.1.1.6 using thin driver. I set the classpath also. It throws me the following exception.
    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:260)
    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 Employee.main(Employee.java:23)
    I am trying to acheive the connection using the following piece of code
    Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@THIRU:1521:ORCL",
                        "scott", "tiger");
    The problem lies in that piece of code only,
    In the TNSNAMES.ora the entries are as follows.
    THIRU =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = Thiru)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = thiru)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    How to solve this one. Can anybody tell me how to provide the proper url.
    thanks in advance

    You were very close.
    "Thiru" as opposed to "THIRU" should be the name of the machine running the database, but that would imply that the DNS lookups are case sensitive, and we know that's not the case.
    My guess, because the network adapter itself is reporting an error, is that "Thiru" evaluates to an IP address that isn't correct, that is, it's trying to make a connection to a specific address and getting nothing back in return.
    Anyway, I think your program(s) are just fine, and your network is misconfigured. Incidently, it is always a good idea in cases like this to use the full name of the machine, for example...
    ...getConnection( "jdbc:oracle:thin:@thiru.maran1977.com:1521:ORCL"...
    and in the database configuration itself...
    (ADDRESS = (PROTOCOL = TCP)(HOST = thiru.maran1977.com)(PORT = 1521))
    You may also use the IP address if you wish.

  • Sql Developer not connecting to Oracle 11g

    hi all
    i have
    windows 7 ultimate 64bit
    Oracle 11g 64bit
    Sql Developer 3
    on same machine i have created Tow Database on 11g :
    ORCL
    ORCL2
    when it was ORCL only everything was Okay
    but recently i have created another database ORACL2
    then it stop connecting with database through SQL DEveloper
    shows error;
    IO Error: the network adapter could not establish the connection
    On commnad prompt
    LSNRCTL> status
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=AStix-PC)(PORT=1521)))
    TNS-12541: TNS:no listener
    TNS-12560: TNS:protocol adapter error
    TNS-00511: No listener
    32-bit Windows Error: 61: Unknown error
    LSNRCTL>
    LSNRCTL> start
    Starting tnslsnr: please wait...
    Service OracleOraDb11g_home1TNSListener already running.
    TNS-12560: TNS:protocol adapter error
    TNS-00530: Protocol adapter error
    How to resolve this issue
    please help me out
    thanks to all

    884559 wrote:
    Have you fixed this issue?
    i m having same problem,i tried so mamy things but i was not able to fix it,
    so i uninstalled oracle and reinstalled it so it startd working fine,
    but agin after 10-15 days this problem started.
    from sqlplus i m able to connect but not using any other 3rd party IDE.
    i have also installed one instant client.
    Thanksno dear yet it's not fixed
    i have focused my mind on my work instead of R & D
    which is unexpected .. that ..no body is here for help...
    thanks

Maybe you are looking for