r - Can not create connection to SQL server using RJDBC -
i installed rjdbc library not able create connection database. same connection string works when utilize rodbc, not sure why rjdbc not able create connection. grateful if guide me solution. using r in mac osx 10.8.2
drv <- jdbc("com.microsoft.sqlserver.jdbc.sqlserverdriver","/library/java/extensions/sqljdbc4.jar", "‘") conn <- dbconnect(drv, "jdbc:sqlserver://data.rsquaredltd.com/****","****","****")
the drv objet created conn fails error message
"error in .jcall(drv@jdrv, "ljava/sql/connection;", "connect", as.character(url)[1], : com.microsoft.sqlserver.jdbc.sqlserverexception: tcp/ip connection host data.rsquaredltd.com/sandp, port 1433 has failed. error: "null. verify connection properties. create sure instance of sql server running on host , accepting tcp/ip connections @ port. create sure tcp connections port not blocked firewall."."
there no firewalls blocking , mentioned, there no problem connecting via rodbc.
your url incorrect. using jdbc:sqlserver://data.rsquaredltd.com/sandp
, should jdbc:sqlserver://data.rsquaredltd.com\sandp
.
the format of jdbc url is:
jdbc:sqlserver://[servername[\instancename][:portnumber]][;property=value[;property=value]]
see building connection url on msdn more information.
r jdbc
No comments:
Post a Comment