Hello All,
I am new to all this (including R) and a disclaimer: I am a health services researcher, not a programmer so forgive me. We are trying to get Achilles up and running.
Our IT Dept DBA has helped me with this problem but we are stumped. He believes this connection is being attempted using SQL Authentication which our SQL server rejects. We cannot find a way to force a Windows Authentication. Tried lots of various ways but here are 3 (below). My code may just be wrong all together.
library(Achilles)
Loading required package: SqlRender
Loading required package: DatabaseConnector
Loading required package: RJDBC
Loading required package: DBI
Loading required package: rJava
Loading required package: rjson
library(RODBC)
ATTEMPT 1:
connectionDetails â createConnectionDetails(dbms=âsql serverâ, server=âXXX.XX.X.Xâ,
-
user="MYNAME", password="MYPASSWORD", schema='OMOP')
achillesResults â achilles(connectionDetails, cdmDatabaseSchema=âOHDSI.OMOPâ,
-
resultsDatabaseSchema="results.OMOP", sourceName="Achillesout",
-
cdmVersion = "5", vocabDatabaseSchema="OHDSI.OMOP")
Connecting using SQL Server driver
Error in .jcall(drv@jdrv, âLjava/sql/Connection;â, âconnectâ, as.character(url)[1], :
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user âMYNAMEâ. ClientConnectionId:9363dff3-4174-439a-a313-421fcbec8583
my note: ERROR MESSAGE HAD THE ACTUAL USERNAME REPORTED, OBVIOUSLY. WE REQUIRE WINDOWS AUTHENTICATION ON OUR SQL SERVER AND ASSUME THAT THIS CODE SETS UP FOR SQL AUTHENTICATION WHICH WILL NOT WORK.
ATTEMPT 2:
connectionDetails â createConnectionDetails(dbms=âsql serverâ, server=âXXX.XX.X.Xâ,
-
domain="OURDOMAIN",
-
user="MYNAME", schema='OMOP')
achillesResults â achilles(connectionDetails, cdmDatabaseSchema=âOHDSI.OMOPâ,
-
resultsDatabaseSchema="results.OMOP", sourceName="Achillesout",
-
cdmVersion = "5", vocabDatabaseSchema="OHDSI.OMOP")
Connecting using SQL Server driver
Warning: Using JTDS driver because a domain is specified. This may lead to problems. Try using integrated security instead.
Error in .jcall(drv@jdrv, âLjava/sql/Connection;â, âconnectâ, as.character(url)[1], :
java.sql.SQLException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
my note: Here We added our server domain name and removed the password. Failed.
ATTEMPT 3:
connectionDetails â createConnectionDetails(dbms=âsql serverâ, server=âOUR IP ADDRESSâ, extraSettings = âtrusted_conection=trueâ)
achillesResults â achilles(connectionDetails, cdmDatabaseSchema=âOHDSI.OMOPâ,
-
resultsDatabaseSchema="results.OMOP", sourceName="Achillesout",
-
cdmVersion = "5", vocabDatabaseSchema="OHDSI.OMOP")
Connecting using SQL Server driver using Windows integrated security
Feb 10, 2017 2:29:45 PM com.microsoft.sqlserver.jdbc.AuthenticationJNI
WARNING: Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path
Error in .jcall(drv@jdrv, âLjava/sql/Connection;â, âconnectâ, as.character(url)[1], :
com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:a35faeb5-4926-42f8-bac6-15a53bccdf44
my note: Here drastically simplified the connectiondetails. Failed.