- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2024 01:17 AM
It seems like the issue might be related to the password generation or the JDBC URL configuration. Here are a few things you can check: NextCareurgentcare
1. Password Generation: Ensure that the generate_tba_password function is correctly implemented and returns a valid password
2. JDBC URL: Make sure the JDBC URL is correctly formatted and does not contain any unnecessary parameters
Remove the ciphersuites parameter if it's present, as the JDBC server automatically selects the appropriate cipher suite
3. CustomProperties: Double-check the CustomProperties in the JDBC URL to ensure they are correctly set.
Here's a revised version of your code with some adjustments:
pwd = generate_tba_password(account_id, consumer_key, token_id, consumer_secret, token_secret)
# Construct the JDBC URL
jdbc_url = f"jdbc:ns://{host}:{port};ServerDataSource=NetSuite2.com;Encrypted=1;NegotiateSSLClose=false;" \
f"CustomProperties=(AccountID={account_id};RoleID={role_id};AuthType=TOKEN;" \
f"TokenID={token_id};TokenSecret={token_secret};ConsumerKey={consumer_key};ConsumerSecret={consumer_secret})"
# Read data from NetSuite
df = spark.read.format("jdbc") \
.option("url", jdbc_url) \
.option("User", "TBA") \
.option("Password", pwd) \
.option("driver", "com.netsuite.jdbc.openaccess.OpenAccessDriver") \
.option("dbtable", "customer") \
.load()
df.show()