I tried the below and I see the same error:
account_id = "xxx_SB1"
role_id = "3"
email = "email"
password = "xxx"
host = "xxx-sb1.connect.api.netsuite.com"
port = 1708
driver = "com.netsuite.jdbc.openaccess.OpenAccessDriver"
jdbc_url = (f"jdbc:netsuite://{host}:{port};"
f"ServerDataSource=NetSuite2.com;"
f"Encrypted=1;"
f"NegotiateSSLClose=false;")
connection_properties = {
"user": email,
"password": password,
"driver": driver,
"CustomProperties": (
f"AccountID={account_id};"
f"RoleID={role_id};"
)
}
try:
df_tables = (spark.read
.jdbc(url=jdbc_url,
table="OA_TABLES",
properties=connection_properties))
# Show the tables your role has access to
print("Successfully connected and retrieved list of available tables:")
df_tables.select("TABLE_SCHEM", "TABLE_NAME", "TABLE_TYPE").show(200, truncate=False)
except Exception as e:
print("Failed to connect and query OA_TABLES..")
print("Error details:")
raise e