Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: The Network Adapter could not establish the connection

  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default The Network Adapter could not establish the connection

    I am able to telnet to the datasource I need and the same code allows me to connect to other instance.
    OracleDataSource Initialization
    java.sql.SQLException: The Network Adapter could not establish the connection
    at oracle.jdbc.driver.SQLStateMapping.newSQLException (SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(D atabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:199)
    at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:480)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:413)
    at oracle.jdbc.driver.PhysicalConnection.<init>(Physi calConnection.java:508)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnect ion.java:203)
    at oracle.jdbc.driver.T4CDriverExtension.getConnectio n(T4CDriverExtension.java:33)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:510)
    at oracle.jdbc.pool.OracleDataSource.getPhysicalConne ction(OracleDataSource.java:275)
    at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:206)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.ge tPhysicalConnection(OracleConnectionPoolDataSource .java:139)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.ge tPooledConnection(OracleConnectionPoolDataSource.j ava:88)
    at oracle.jdbc.pool.OracleImplicitConnectionCache.mak eCacheConnection(OracleImplicitConnectionCache.jav a:1567)
    at oracle.jdbc.pool.OracleImplicitConnectionCache.mak eOneConnection(OracleImplicitConnectionCache.java: 499)
    at oracle.jdbc.pool.OracleImplicitConnectionCache.def aultUserPrePopulateCache(OracleImplicitConnectionC ache.java:218)
    at oracle.jdbc.pool.OracleImplicitConnectionCache.<in it>(OracleImplicitConnectionCache.java:194)
    at oracle.jdbc.pool.OracleConnectionCacheManager.crea teCache(OracleConnectionCacheManager.java:269)
    at oracle.jdbc.pool.OracleDataSource.cacheInitialize( OracleDataSource.java:391)
    at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:372)
    at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:178)
    at oracle.jdbc.pool.OracleDataSource.getConnection(Or acleDataSource.java:156)
    at Queries.JDBCUtils.getConnection(JDBCUtils.java:90)
    at Queries.JDBCUtils.getConnection(JDBCUtils.java:82)
    at Queries.PostTransactions.validConnection(PostTrans actions.java:35)
    at Queries.PostTransactions.main(PostTransactions.jav a:151)
    Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
    at oracle.net.nt.ConnStrategy.execute(ConnStrategy.ja va:328)
    at oracle.net.resolver.AddrResolution.resolveAndExecu te(AddrResolution.java:421)
    at oracle.net.ns.NSProtocol.establishConnection(NSPro tocol.java:630)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:3 10)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnec tion.java:966)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:292)
    ... 21 more
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Un known Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress( Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.ja va:127)
    at oracle.net.nt.ConnOption.connect(ConnOption.java:1 26)
    at oracle.net.nt.ConnStrategy.execute(ConnStrategy.ja va:306)
    ... 26 more
    Yes
    Any suggestions?


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,355
    Thanks
    182
    Thanked 833 Times in 776 Posts
    Blog Entries
    5

    Default Re: The Network Adapter could not establish the connection

    Check firewall. Check db permits remove connections. Check username/password

  3. #3
    Junior Member
    Join Date
    Aug 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: The Network Adapter could not establish the connection

    Quote Originally Posted by copeg View Post
    Check firewall. Check db permits remove connections. Check username/password
    I switched hosts and it worked. I was never able to find out why I could not connect.

Similar Threads

  1. Replies: 0
    Last Post: June 19th, 2012, 01:58 PM
  2. What classes do I need to establish an ssh connection?
    By slashdevslashnull in forum Java Networking
    Replies: 2
    Last Post: June 30th, 2011, 11:41 PM
  3. Replies: 0
    Last Post: March 26th, 2011, 12:07 PM
  4. blocking a network connection
    By BraveProgrammer in forum Java Networking
    Replies: 4
    Last Post: September 2nd, 2010, 01:08 PM