on 01-24-2022 5:27 AM
Hello,
I have one question,
does this code will work for SAP HANA Cloud instances?
I tried using hana instance in databricks and I am getting handshake_Failure error.
JDBCDriverException: SAP DBTech JDBC: Cannot connect to jdbc:sap://XXXXXXXX:443 [Cannot connect to host XXXXXXX:443 [Received fatal alert: handshake_failure], -813.]. Caused by: JDBCDriverException: SAP DBTech JDBC: SSL handshake failed : Received fatal alert: handshake_failure. Caused by: SSLHandshakeException: Received fatal alert: handshake_failure
my configuration is
%scala
import java.util.Properties
//Set connection parameters
val jdbcHostname = "XXXX.hana.canary-eu10.hanacloud.ondemand.com"
val jdbcPort = "443"
val jdbcDB = "XXXX"
val jdbcUser = "user"
val jdbcPassword = "<password>"
val driverClass = "com.sap.db.jdbc.Driver"
val jdbcUrl = s"jdbc:sap://${jdbcHostname}:${jdbcPort}"
//Check availability of the JDBC library to access SAP HANA
Class.forName(driverClass)
//Set connection properties
val connectionProperties = new Properties()
connectionProperties.put("user", s"${jdbcUser}")
connectionProperties.put("password", s"${jdbcPassword}")
connectionProperties.setProperty("Driver", driverClass)
//Read and display data
val sflight = spark.read.jdbc(jdbcUrl, "<schema.table>", connectionProperties)
//sflight.show()
I fixed this issue by updating my spark version to 3.2.*.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akshay,
Yes, I am able read/write data to Hana using Databricks Scala and also using hdbcli module.
Could you please share your findings and code block for reference? I am able to to read data but during execution I am getting an error
`Can't get JDBC type for struct<customer_index:bigint,email:string,phone:string,type:string>`
How are you providing the schema for your data while writing data to HANA when the table does not exist?
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.