Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 05:03 AM
Hi @berserkersap thanks for your answer. I was able to solve the problem in 2 ways:
1) downgrading the Runtime version to 12.2 and then the installer of msodbcsql17 no longer failed (with the error Can't open lib 'ODBC Driver 17 for SQL Server' : file not found)
2) use a Java wrapper in this way:
url=f"jdbc:sqlserver://{server};encrypt=true;user={username};password={password};databaseName={database};"
sql_driver_manager=spark._sc._gateway.jvm.java.sql.DriverManager
con = sql_driver_manager.getConnection(url)
con.prepareCall("INSERT INTO... ").execute()
con.close()