Skip to content

Accessing Sybase IQ data from R

September 4, 2012



This post describes how to connect from RGui to Sybase IQ 15.2 using JDBC.




The procedure here described has been tested using the following environment:

  • RGUI for R version 2.15.1 on Windows 7 pro 32b.
  • Sybase IQ 15.2 ESD # 3 on Solaris 10, Sun Sparc x64 architecture.
  • Sybase JConnect 7.07
  • JDK 1.6.0




  1. On RGUI, install the RJDBC package
    1. Go to Packages à Install package(s)
    2. Select your region
    3. Select RJDBC and click OK


  2. Download and install JConnect 7.07. This can be found in Sybase Support Website


  3. On RGUI, load the RJDBC package
    1. Go to Packages à Load Package à RJDBC


  4. Create a new DBI object

    > drv<-JDBC(“com.sybase.jdbc4.jdbc.SybDriver”, “C:/Sybase/jConnect-7_0/classes/jconn4.jar”, “\””)

  5. Create a new dbConnect object

    > conn <- dbConnect(drv, “jdbc:sybase:Tds:myserver:4200”, “myUser”, “MyPassword”)

    In this example I’m connecting to a server named myserver where Sybase IQ is accepting connections on port 4200. I connect with the user “myUser” secure with the password “myPassword”.

  6. Test if the connection is working.

    > dbListTables(conn)

    A list of all the tables in the database should be displayed.




From → Analytics, SAP IQ

  1. Dmitry permalink

    Please change ‘smart quotes’ to ‘dumb quotes’ in the examples, otherwise they do not work, e.g.

    > drv drv<-JDBC("com.sybase.jdbc4.jdbc.SybDriver", "C:/Sybase/jConnect-7_0/classes/jconn4.jar", "\"")

  2. Pradeep permalink

    Thank you for this post, saved me a lot of time.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: