R Hana authentication with Kerberos and ODBC JDBC - r

I was trying to connect to Hana from R using JDBC.
It gives the below error.
I have the kerberos setting AuthMech KerberosFDQN etc configured too.
Any clue possible root cause for this error
odbcconn <- odbcConnect("HD2")
Warning messages:
1: In RODBC::odbcDriverConnect("DSN=HD2") :
[RODBC] ERROR: state 08S01, code -10709, message [unixODBC][SAP AG][LIBODBCHDB SO][HDBODBC] Communication link failure;-10709 Connection failed (RTE:[200106] Protocol error, invalid authentication packet (m_server_at_my_company.com:30050))
2: In RODBC::odbcDriverConnect("DSN=HD2") : ODBC connection failed

Related

Getting this error Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection

I am new to Oracle, installed oracle SQL developer but each time I try to connect, I get the error:
Status: Failure -Test failed: IO Error: The Network Adapter could not
establish the connection
and the oracleTNSlistener service turns off on its own. Each time I start the service, it turns off immediately on its own.

difference between server and DSN in RDOBC package

I'm trying to connect to a MS SQL database via RODBC package. The following is not working :
ch = odbcDriverConnect(paste0("Driver=MSODBC;DSN=D.ad009.win.org;database=LCA;UID=LCA-User;PWD=xxxx"))
Warning messages:
1: In odbcDriverConnect(paste0("Driver=MSODBC;DSN=D.ad009.win.org;database=LCA;UID=LCA-User;PWD=xxxx")) :
[RODBC] ERROR: state 08001, code 0, message [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Neither DSN nor SERVER keyword supplied
2: In odbcDriverConnect(paste0("Driver=MSODBC;DSN=D.ad009.win.org;database=LCA;UID=LCA-User;PWD=xxxx")) :
ODBC connection failed
But changing the DSN to server will solve the problem :
ch = odbcDriverConnect(paste0("Driver=MSODBC;server=D.ad009.win.org;database=LCA;UID=LCA-User;PWD=xxxx"))
ch
RODBC Connection 8
Details:
case=nochange
DRIVER=MSODBC
SERVER=D.ad009.win.org
UID=LCA-User
PWD=******
WSID=d04x
DATABASE=LCA
I was wondering what is the difference between DSN and server ???

(434) WSA E TimedOut: Lost socket connection to the Teradata server in R

I am trying to connect to Teradata in R using an ODBC connection. I use the same configuration on my local machine and it works. However, when I connect through a server it throws the below error.
I have set up an ODBC DSA connection using the teradata driver with all the connection credentials.
How do I fix this?
> con <- odbcConnect("Terr_Con")
Warning messages:
1: In RODBC::odbcDriverConnect("DSN=Terr_Con") :
[RODBC] ERROR: state HY000, code 434, message [Teradata][socket error] (434) WSA E TimedOut: Lost socket connection to the Teradata server
2: In RODBC::odbcDriverConnect("DSN=Terr_Con") :
ODBC connection failed

RODBC connection from R to SQL failing

I'm using R Studio to connect to SQL Server Management using library(RODBC).
Note that the below code works on my local system, but does not work when trying to connect remotely.
This is my connection code:
connection <- RODBC::odbcDriverConnect( 'driver={SQL Server};server=SERVERNAME ;database=DBNAME;trusted_connection=TRUE' )
I get the following warning message:
Warning messages:
1: In RODBC::odbcDriverConnect("driver={SQL Server};server=SERVERNAME;database=DBNAME;trusted_connection=TRUE") :
[RODBC] ERROR: state 08001, code 18, message [Microsoft][ODBC SQL Server Driver][DBNETLIB]SSL Security error
2: In RODBC::odbcDriverConnect("driver={SQL Server};server=SERVERNAME;database=DBNAME;trusted_connection=TRUE") :
[RODBC] ERROR: state 01000, code 772, message [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (SECDoClientHandshake()).
3: In RODBC::odbcDriverConnect("driver={SQL Server};server=SERVERNAME;database=DBNAME;trusted_connection=TRUE") :
ODBC connection failed
It's really odd because I definitely have access to the server and database in question.
It's worth noting that I have access to the server from a local system (above code works) and access to a remote system (code does not work).
Any idea why this might be happening?
RODBC is not a great package, it would be much better to use the RStudio built odbc instead:
library(odbc)
con <- dbConnect(odbc(),
Driver = "SQL Server",
Server = "SERVER",
Database = "DATABASE",
Trusted_Connection = "True" ,
timeout = 5000
)
In the following command line
connection <- RODBC::odbcDriverConnect( 'driver={SQL Server};server=SERVERNAME ;database=DBNAME;trusted_connection=TRUE' )
make trusted_connection = FALSE or no. Its a simple case of SSL error. If you are using linux, for server, use ip address rather than hostname.

Error in connecting R to Redshift

I'm trying to connect RStudio to Amazon Redshift via JDBC and this is what I tried to run:
driver <- JDBC("com.amazon.redshift.jdbc42.Driver", "~/Downloads/RedshiftJDBC42-1.2.1.1001.jar", identifier.quote="`")
# url <- "<JDBCURL>:<PORT>/<DBNAME>?user=<USER>&password=<PW>
url <- "jdbc:redshift://<cluster-name>.<xxxxxx>.us-east-1.redshift.amazonaws.com:5439/<dbname>?user=<username>&password=<password>"
conn <- dbConnect(driver, url)
When executing dbConnect(), I get the following error:
Error in .jcall(drv#jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], :
java.sql.SQLException: [Amazon](500150) Error setting/closing connection: Operation timed out.
Any idea what is causing this and how to fix it?
Update: There was a problem with access through security groups. If you're having a similar issue, check the inbound rules of your security group and make sure they allow access to Redshift via your IP.

Resources