Я не могу подключиться к R с MS SQL, используя RODBC, а также RJDBC
С RODBC
library(RODBC)
dbhandle <- odbcDriverConnect(paste("driver={SQL Server};server=", sname, ";database=",
dbname, ";uid=", user,";pwd=",password, sep = ""))
res <- sqlFetch(dbhandle, client.table_name)
Ошибка, которую я получаю:
Warning messages:
1: In odbcDriverConnect(paste("driver=SQL Server;server=", sname, ";database=", :
[RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found
2: In odbcDriverConnect(paste("driver=SQL Server;server=", sname, ";database=", :
ODBC connection failed
Также я пытался с RJDBC
library(rJava)
library(RJDBC)
drv <- JDBC(driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver",
classPath="/home/****/sqljdbc_4.2/enu/jre8/sqljdbc42.jar")
conn <- dbConnect(drv, paste0("jdbc:sqlserver://",client.hostname),
user=client.username , password=client.password, dbname = client.dbName)
Ошибка
Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], :
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server did not return a response. The connection has been closed. ClientConnectionId:253fd8d2-8e60-40fb-96b0-220745818166".