Netsuite error - The driver could not open a JDBC connection. Check the URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
β06-24-2025 12:54 PM
I'm trying to connect to Netsuite2 with the JDBC driver I added to my cluster. I'm testing this in my Sandbox Netsuite and I have the below code but it keeps saying:
requirement failed: The driver could not open a JDBC connection. Check the URL: jdbc:netsuite://xxxxx-sb1.connect.api.netsuite.com:1708;ServerDataSource=NetSuite2.com;Encrypted=1;NegotiateSSLClose=false ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
β06-24-2025 02:16 PM
Hey @KristiLogos
I had a little search online and found this which may be useful:
in short it seems that a token based connection is not possible with spark/JDBC as the connection made is single use: and spark is effectively making two connections - one for metadata and one for data.
The author managed to solve their issue by swapping over to username/password authentication. Even if itβs not viable long-term, could you try making a connection this way instead, to confirm that is the issue?
TheOC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
β06-25-2025 03:29 AM
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