admin 管理员组文章数量: 1086019
I'm a novice at R, but our anization recently started using code based in R that reads from SQL Server. I did all the downloads required and am trying to run the following code in the instructions below:
In R, use the following command to install DatabaseConnector install.packages("DatabaseConnector")
Windows authentication for SQL Server: To be able to use Windows authentication for SQL Server (and PDW), you must install the JDBC driver. Download version 9.2.0 .zip from Microsoft and extract its contents to a folder. In the extracted folder you will find the file sqljdbc_9.2/enu/auth/x64/mssql-jdbc_auth-9.2.0.x64.dll (64-bits) or ssqljdbc_9.2/enu/auth/x86/mssql-jdbc_auth-9.2.0.x86.dll (32-bits), which needs to be moved to location c:/temp
Test connection using script below:
Sys.setenv("PATH_TO_AUTH_DLL" = "c:/temp") conn <- connect(dbms = "sql server", server = "*CaboodleServerName", pathToDriver = "c:/temp") dbGetQuery(conn, "SELECT COUNT(*) FROM OMOP.cdm.concept") disconnect(conn)
I get the following error and I'm not sure what to do to resolve it. Any help would be appreciated
> Sys.setenv("PATH_TO_AUTH_DLL" = "C:/Users/LASCHE/Documents/OMOP/Jar")
> Sys.setenv("DATABASECONNECTOR_JAR_FOLDER" = "C:/Users/LASCHE/Documents/OMOP/Jar")
> conn <- connect(dbms = "sql server", server = "caboodlesql62d",pathToDriver = "C:/Users/LASCHE/Documents/OMOP/Jar")
Connecting using SQL Server driver
- Using Windows integrated security
Looking for authentication DLL in path specified in PATH_TO_AUTH_DLL: C:/Users/LASCHE/Documents/OMOP/Jar
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.io.IOException: Failed to get field handle to set library path
> dbGetQuery(conn, "SELECT COUNT(*) FROM OMOP.cdm.concept")
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'conn' in selecting a method for function 'dbGetQuery': object 'conn' not found
> disconnect(conn)
Error: object 'conn' not found
本文标签: Error connecting to SQL Server (windows authentication) with R and JDBCStack Overflow
版权声明:本文标题:Error connecting to SQL Server (windows authentication) with R and JDBC - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744065498a2527515.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论