2017-09-01 51 views
0

我創建了一個到Cloud上的Db2 Warehouse的連接:dashDB for Analytics-t1/Database:BLUDB。我已經給出'dashdb connect'作爲連接名稱。IBM Data Science Experience(DSX):在RStudio上使用ibmdbR

然後我選擇了Tools/RStudio。在RStudio中,我運行了以下幾行。下面的錯誤消息。

代碼片段:

library(ibmdbR) 
con <- idaConnect('BLUDB','','') 
#Close the connection 
idaClose(con) 

輸出:

con <- idaConnect('BLUDB','','') 
Warning messages: 
1: In RODBC::odbcDriverConnect("DSN=BLUDB", believeNRows = FALSE) : [RODBC] ERROR: state 08001, code -30082, message [unixODBC][IBM][CLI Driver] SQL30082N Security processing failed with reason "17" ("UNSUPPORTED FUNCTION"). SQLSTATE=08001 
2: In RODBC::odbcDriverConnect("DSN=BLUDB", believeNRows = FALSE) : ODBC connection failed 

回答

1

您的代碼段將只上班是,如果你在RStudio從DB2數據倉庫控制檯運行它。如果您在DSX內啓動RStudio,則需要配置連接。以下爲我工作:

install.packages("ibmdbR") 
library(ibmdbR) 
dsn_driver <- "BLUDB" 
dsn_database <- "BLUDB" 
dsn_hostname <- "..." 
dsn_port <- "50000" 
dsn_protocol <- "TCPIP" 
dsn_uid <- "..." 
dsn_pwd <- "..." 
con_path <- paste(dsn_driver,";DATABASE=",dsn_database,";HOSTNAME=",dsn_hostname,";PORT=",dsn_port,";PROTOCOL=",dsn_protocol,";UID=",dsn_uid,";PWD=",dsn_pwd,sep="") 
ch <-idaConnect(con_path) 
idaInit(ch) 
idaShowTables() 

用您的憑據替換「...」,你應該很好去。 我遵循本頁中名爲「Connect to dashDB in RStudio」的視頻中的說明:https://datascience.ibm.com/docs/content/analyze-data/rstudio-overview.html,並找到以下文檔:https://datascience.ibm.com/blog/dashdb-r-dsx/

相關問題