I am trying to connect to a SQL database in Python, but I am have difficult finding documentation/examples of connecting to a JDBC. I can do this in MATLAB using the following code:
`Name = 'ServerName';
Username = '';
Password = '';
Server = ['jdbc:sqlserver://ServerName:1433;'...
'database=DB;',...
'applicationIntent=ReadOnly;',...
'integratedSecurity=true;'];
Connection = database('DB',Username , Password,...
'com.microsoft.sqlserver.jdbc.SQLServerDriver', Server );`
I would like to do this in Python. Because of the JDBC, I don't think I can use pymssql or pyodbc (I have tried). I have tried, and failed, using the following:
`import jaydebeapi
conn = jaydebeapi.connect('com.microsoft.sqlserver.jdbc.SQLServerDriver',
[Server , Username,Password])`
Any help in implementing this in Python would be great, thanks!