Not able to connect to Oracle DB getting error as java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

Shiv

Here is the code which i am trying- ORACLE driver is loaded successfully but getting in get connection that statement-

public class OracelConn {
   public static void main(String[] args) throws Exception {
      try {
         try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
         } catch (ClassNotFoundException e) {
            System.out.println("Please include Classpath  Where your ORACLE Driver is located");
            e.printStackTrace();
            return;
         }
         System.out.println("ORACLE driver is loaded successfully");
         Connectioncon=DriverManager.getConnection( "jdbc:oracle:thin:or0132p.exg.com:1521:OP0132.exg.com", "wsteam", "wsteam");

         Statement stmt = con.createStatement();
         ResultSet rs = stmt.executeQuery("select TC_ORDER_ID from orders where tc_order_id='0296906379'");
         while (rs.next())
            System.out.println(rs.getString("TC_ORDER_ID"));

         con.close();
         } catch (Exception e) {
             System.out.println(e);
         }
      }
   }
Sukhpal Singh

There seems to be an issue with your URL format. Below are supported formats:

If you have an SID, use this (older) format:

jdbc:oracle:thin:@[HOST][:PORT]:SID

If you have an Oracle service name, use this (newer) format:

jdbc:oracle:thin:@//[HOST][:PORT]/SERVICE

Source: orafaq

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Could not get JDBC Connection; nested exception is java.sql.SQLException: JZ002: Password property '' too long. Maximum length is 30

分類Dev

exception:java.sql.SQLException:illegal connection port value '3306:etude'

分類Dev

Could not able to release a file. getting error: could not compile 'libc'

分類Dev

Oracle DB:java.sql.SQLException:閉じられた接続

分類Dev

Socket.io keeps trying to establish a connection

分類Dev

Spring integration - Retry to establish connection on exception scenarios

分類Dev

How to solve an exception java.sql.SQLException: No suitable driver found?

分類Dev

RecyclerView adapter connection error: no adapter attached

分類Dev

error : "java.sql.SQLException: No value specified for parameter 1 "

分類Dev

Unable to establish connection with MLME connect failed: ret=-1 (Operation not permitted)

分類Dev

Yii DB Connection Error

分類Dev

ssrs DB connection error

分類Dev

I have a error Exception in thread "main" java.lang.NullPointerException when I connect SQL Server and Check User in table

分類Dev

Failed to parse configuration class, nested exception is java.io.FileNotFoundException: Could not open resource [/test.properties]

分類Dev

java.sql.SQLException:Io例外:OracleとのJDBC接続中に読み取り呼び出しからマイナス1を取得しました

分類Dev

Connection to Oracle using Oracle.ManagedDataAccess exception

分類Dev

Upgrading from MySQL 5.5 to 5.6 and getting "SQLException: Connection is closed"

分類Dev

Trying to change connection host name in perl script that connect to SQL Server DB

分類Dev

Connection failed to open the DB connection: could not find driver

分類Dev

How to connect to Azure Oracle 12c Database using sqlplus or sql developer cloud connection

分類Dev

Worklight 6.1, SQL Adapter (Oracle 11g) JNDI error on Tomcat 7.0.42

分類Dev

RxJs webSocket not able to connect to a websocket server implemented with socket.io

分類Dev

Tomcat 8 - java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql://xxx/myApp'

分類Dev

how can i solve this error, javax.servlet.ServletException: java.sql.SQLException: No database selected

分類Dev

Reactjs is unable to establish socket connection, it opens and getting response while calling on componentDidMount

分類Dev

Gigya - Error 500000 - Could not connect to host

分類Dev

Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Could not open connection

分類Dev

SQL Connection Error Message

分類Dev

ます。java.sql.SQLException:MONTH

Related 関連記事

  1. 1

    Could not get JDBC Connection; nested exception is java.sql.SQLException: JZ002: Password property '' too long. Maximum length is 30

  2. 2

    exception:java.sql.SQLException:illegal connection port value '3306:etude'

  3. 3

    Could not able to release a file. getting error: could not compile 'libc'

  4. 4

    Oracle DB:java.sql.SQLException:閉じられた接続

  5. 5

    Socket.io keeps trying to establish a connection

  6. 6

    Spring integration - Retry to establish connection on exception scenarios

  7. 7

    How to solve an exception java.sql.SQLException: No suitable driver found?

  8. 8

    RecyclerView adapter connection error: no adapter attached

  9. 9

    error : "java.sql.SQLException: No value specified for parameter 1 "

  10. 10

    Unable to establish connection with MLME connect failed: ret=-1 (Operation not permitted)

  11. 11

    Yii DB Connection Error

  12. 12

    ssrs DB connection error

  13. 13

    I have a error Exception in thread "main" java.lang.NullPointerException when I connect SQL Server and Check User in table

  14. 14

    Failed to parse configuration class, nested exception is java.io.FileNotFoundException: Could not open resource [/test.properties]

  15. 15

    java.sql.SQLException:Io例外:OracleとのJDBC接続中に読み取り呼び出しからマイナス1を取得しました

  16. 16

    Connection to Oracle using Oracle.ManagedDataAccess exception

  17. 17

    Upgrading from MySQL 5.5 to 5.6 and getting "SQLException: Connection is closed"

  18. 18

    Trying to change connection host name in perl script that connect to SQL Server DB

  19. 19

    Connection failed to open the DB connection: could not find driver

  20. 20

    How to connect to Azure Oracle 12c Database using sqlplus or sql developer cloud connection

  21. 21

    Worklight 6.1, SQL Adapter (Oracle 11g) JNDI error on Tomcat 7.0.42

  22. 22

    RxJs webSocket not able to connect to a websocket server implemented with socket.io

  23. 23

    Tomcat 8 - java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql://xxx/myApp'

  24. 24

    how can i solve this error, javax.servlet.ServletException: java.sql.SQLException: No database selected

  25. 25

    Reactjs is unable to establish socket connection, it opens and getting response while calling on componentDidMount

  26. 26

    Gigya - Error 500000 - Could not connect to host

  27. 27

    Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Could not open connection

  28. 28

    SQL Connection Error Message

  29. 29

    ます。java.sql.SQLException:MONTH

ホットタグ

アーカイブ