Hi! I was trying to connect to the database server using the JDBC protocol but got error as attached:
`details ← createConnectionDetails(dbms = “postgresql”,
server = paste0(server,’/’,db_name),
user = Sys.getenv(“JHED”),
password = Sys.getenv(“JHED_PWD”),
pathToDriver = Sys.getenv(x = “db_driver”),
port = 1433)
conn ← connect(details)
Connecting using PostgreSQL driverError in rJava::.jcall(jdbcDriver, “Ljava/sql/Connection;”, “connect”, :
org.postgresql.util.PSQLException: The connection attempt failed.`
Is there any things I could try to address this issue? Thanks in advance for any responses!
I was able to connect to the data server via ODBC protocol with port = 1433 specified. This was provided by instruction I received from my coworker. When the port = 1433, I got an error saying:
I’m not sure if I understand correctly about what you mean by authentication, but when I connect to the database via ODBC protocol, authentication I used include driver, port, drv, server, database, uid (with my user name), pwd, and TDS_version. However, when I tried to use the ‘Databaseconnector’ package, it asked me to provide ‘pathtodriver’ and the attempts failed for reasons I dont know.
Have you acquired and added the DLL file described in the following section?
The other options to try disabling encryption using connectionString and .NET API as arguments (NOTE: This has significant security implications, check with your IT department if it is permissible in your environment)
Here is an example (you don’t need to use all of the arguments in this example)
Thank you so much for sharing, Hayden. Yeah we reached out to the IT department for this matter! Your advice has been very helpful to me. Appreciate it!