Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Apache Spark oracle DB JDBC Connection Failure

User_OUTINMar 19 2021 — edited Mar 19 2021

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

Comments

526209
Ok, so I've poked around a bit more and have found more info on DB_DBT_APPMALLOC:

http://www.sleepycat.com/docs/api_cxx/db_associate.html

"""
If the callback function needs to allocate memory for the data field rather than simply pointing into the primary key or datum, the flags field of the returned Dbt should be set to DB_DBT_APPMALLOC, which indicates that Berkeley DB should free the memory when it is done with it.
"""

This seems to answer my earlier questions. Thanks for your patience :)
1 - 1

Post Details

Added on Mar 19 2021
0 comments
1,244 views