Shiny, R and SQL Server

1,578 views
Skip to first unread message

Sam

unread,
Jun 18, 2013, 5:14:39 AM6/18/13
to shiny-...@googlegroups.com
Hi,
 
I have successfully setup shiny-server and able to browse my samples. I am now trying to connect to SQL Server DB from R and need to deploy this on shiny-server. Does any one know how to set this up. Please share the detailed steps or any documentation that you have.
 
Thanks,
Sam.

Alex Brown

unread,
Jun 19, 2013, 1:55:01 AM6/19/13
to shiny-...@googlegroups.com
Depends upon the platform and the database, mainly I'd say use R's standard database access packages.

Joe Cheng

unread,
Jun 19, 2013, 2:16:39 PM6/19/13
to shiny-...@googlegroups.com
Here's what worked for me (with the RODBC package):


But you might be better off with the RJDBC package instead, security and performance wise:


On Tue, Jun 18, 2013 at 10:55 PM, Alex Brown <alexb...@gmail.com> wrote:
Depends upon the platform and the database, mainly I'd say use R's standard database access packages.

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Sam

unread,
Jun 24, 2013, 6:52:09 AM6/24/13
to shiny-...@googlegroups.com
Thanks Joe. This is really helpful. I need further help on this. Is there a way to encrypt user name and password that i pass in connection string?   Or how can we setup DSN for JDBC in Linux which i can refer in applications. I don't want to pass DB credentials as plain text :(

Dieter Menne

unread,
Jun 25, 2013, 2:16:44 AM6/25/13
to shiny-...@googlegroups.com


Am Montag, 24. Juni 2013 12:52:09 UTC+2 schrieb Sam:
Is there a way to encrypt user name and password that i pass in connection string?

Since this is not a Shiny-related question, Stack Overflow or SQL Forum would be a better place to go.

Sam

unread,
Jun 25, 2013, 8:12:24 AM6/25/13
to shiny-...@googlegroups.com
Hi, makes sense. One Final question -> can you help me with the syntax to build the connection string dynamically based on user input. For Example i have a select box with all different database names. I need to connect to respective database based on that selection.

I am trying to build the databaseName part dynamically in the below connection string. 

 conn <- dbConnect(drv, "jdbc:sqlserver://serverName; databaseName=DBName", "userID", "password")

Thanks
Sam
Reply all
Reply to author
Forward
0 new messages