Connect R and Teradata using JDBC

后端 未结 1 1137
無奈伤痛
無奈伤痛 2021-01-06 11:02

I´m trying to connect R and Teradata using RJDBC.

I´ve found this link that has an example using mysql, but i´m nos sure how to do the same with teradata.



        
相关标签:
1条回答
  • 2021-01-06 11:59

    Using the R Console, enter the following steps below to make a Teradata connection:

    drv = JDBC("com.teradata.jdbc.TeraDriver","ClasspathForTeradataJDBCDriverFiles") 
    

    Example:

    drv = JDBC("com.teradata.jdbc.TeraDriver","c:\\terajdbc\\terajdbc4.jar;c:\\terajdbc\\tdgssconfig.jar")  
    

    NOTE: A path on a UNIX machine would use single forward slashes to separate its components and a colon between files.

    conn = dbConnect(drv,"jdbc:teradata://DatabaseServerName/ParameterName=Value","User","Password") 
    

    Example:

    conn = dbConnect(drv,"jdbc:teradata://jdbc1410ek1.labs.teradata.com/TMODE=ANSI,LOGMECH=LDAP","guestldap","passLDAP01")
    

    NOTE: Connection parameters are optional. The first ParameterName is separated from the DatabaseServerName by a forward slash character.

    dbGetQuery(conn,"SQLquery")
    

    Example:

    dbGetQuery(conn,"select ldap from dbc.sessioninfov where sessionno=session")
    
    0 讨论(0)
提交回复
热议问题