Forum Stats

  • 3,758,407 Users
  • 2,251,383 Discussions
  • 7,870,183 Comments

Discussions

Apache Spark oracle DB JDBC Connection Failure

User_OUTIN
User_OUTIN Member Posts: 1 Red Ribbon
edited Mar 19, 2021 12:37PM in APEX Discussions

Hello Team,

Could you please advise or suggest me why did the following connection failed. still we couldn't identify where did the issue persists?

df = spark.read \

  .format("jdbc") \

  .option("url", "jdbc:oracle:thin://HOSTNAME:PORT/SERVICENAME") \

  .option("dbtable", "DB.TableName") \

  .option("user", "") \

  .option("password", "") \

  .option("driver", "oracle.jdbc.driver.OracleDriver") \

  .load()

we are getting the following error:

Py4JJavaError: An error occurred while calling o268.load.

: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection

Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection

at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:445)

at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:464)

at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:594)

at oracle.net.ns.NSProtocolStream.negotiateConnection(NSProtocolStream.java:214)

at oracle.net.ns.NSProtocol.connect(NSProtocol.java:263)

at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1360)

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:486)

... 26 more

Caused by: java.net.SocketTimeoutException: connect timed out

Here we are not listening the default port 1521.it is the different custom port.Could you please help me why did the above error is throwing..it would be helpful.


Thanks

Tagged: