I am trying to access the database using RJDBC from RStudio but I am getting the following error.
I am unable to understand my mistake. I will be appreciated if somebody help me on this.
Code:
install.packages("RJDBC")
library(RJDBC)
drv <- JDBC("com.microsoft.sqlserver.jdbc.SQLServerDriver","c://sqljdbc42.jar")
conn <- dbConnect(drv, "jdbc:sqlserver://191.169.120.213:1433", "username", "password")
Output:
Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], :
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 192.168.120.213, port 1433 has failed. Error: "Connection timed out: no further information. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
Note: I do not have any firewall related issue.