connecting shiny webapp to oracle database - r

I am building a shiny web app with r studio.
Now I want data from my companys oracle sql server on it.
On my computer, I can easily establish a connection via odbc, because I have the driver on my computer. With code like this:
con <- dbConnect(odbc::odbc(), "name", UID="uid", PWD= "pwd")
Now, is this connection possible when uploaded to shinyapps.io?
Also, with this code, I can only connect inside our companys vpn-network. How do I establish a connection from outside? I tried adding host and port, but that does not work.
Thanks a lot :)

Related

Connecting to An External (outside of Google Cloud Platform) PostgreSQL db from Google Cloud Run

I've been going around in circles trying to look for information on this, and all I find is connecting to Google Cloud SQL from Google Cloud Run - this is not what I want.
I have a PostgreSQL database installed on a server, outside of GCP. I have a R Shiny app, being deployed as a docker container thru Google Cloud Run, that needs access to the PostgreSQL database that lives outside of GCP.
When I run my R Shiny docker container on my local machine, using docker desktop, it works fine. The connection is made and I see no errors. I logged into my postgresql db directly with the username/password and I also could log in, no problem.
When I run my R Shiny docker container in Google Cloud Run, I get the following errors:
Warning: Error in postgresqlNewConnection: RS-DBI driver: (could not connect xxxx#xxpostgresxx.client.ext:5432 on dbname "db_name": could not translate host name "xxpostgresxx.client.ext" to address: Name or service not known
In my *.R file, the connection is written like this:
drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv, host = "xxx.xxx.ext", port = "5432", dbname = "db_name", user = "xxxx", password = "xxxx")
Is this an issue with my external PostgreSQL db not allowing the Google Cloud Run url to access it's database? Is it something with the "RS-DBI driver" itself? Or is there something I need to setup somewhere in GCP to get this connection to work?
I've tried pulling in the DBI library before the RPostgreSQL library (someone mentioned it) but that didn't solve anything.
I am a newbie with Google Cloud Platform, so you'll probably have to give more detail in your explanations. Thank you so much in advance.
=====================================
UPDATE:
So in order to make this work, I had to set up a "Serverless VPC access" without networking people to allow my Cloud Run service to connect to resources within our private VPN network.
Cloud Run needs a public IP or DNS name by which to locate your Postgres database; it appears to be having problems using xxx.xxx.ext.
I'm unfamiliar with .ext. Is that a legitimate public Internet DNS name? If not, that's your (first) problem.
Corrollary: could any other entity on the Internet, use a Postgres client and suitable credentials connect to that Postgres database?

Unable to connect non-system databases in rstudio

I've been trying to connect DB(sql server management studio) to rstudio.
This is what i have tried
# Importing and listing the drivers usiang the ODBC
library(odbc)
odbcListDrivers()
sort(unique(odbcListDrivers()[[1]]))
# Database connection using DBI
library(DBI)
con <- dbConnect( odbc(),
Driver = "SQL Server",
Server="localhost\\SQLEXPRESS",
Database="master",
Trusted_Connection="True"
)
The above code successfully connects to the db but i can see only the system databases under the connection tab. The non-system db the user defined ones are not show in the connection panel of the R studio. How to fix this.
Connections panel
Non-system dbs in the database

Connect R to SQL server in a Remote AWS EC2 Server

I’m trying to make queries in R using a SQL Server database hosted in a EC2 Virtual Machine.
This is a Windows Machine and SQL Server has a Windows identification.
I tried with dbConnect, odbcDriverConnect and DBI::dbConnect commands, but I am not be able to make the connection.
Could do you please help me?
Thanks in advance!

Data source name is not appearing in System DSN for MS access ODBC connection

Can anyone help me with this?
I have to connect the oracle data source in MS access which has already connected with some HANA server. But now i want to connect it to oracle.
I have done the odbc connection in System DSN from Administrator tools. Connection successful. But, still i cannot see that DSN in System DSN.
Tried the following steps but still not working
1. Modified default value as "value not set" in regedit.
2. created System DSN through this "C:\windows\SysWOW64"
TIA

Tableau Server Error connecting to ODBC driver

I can able to connect/fetch data from Tableau Desktop but in tableau server it is throwing below error with datasource, Datasource is build on BI ODBC driver. Access permission are assign granted to root folder Oracle_HOME.
Based on the error, it seems the the driver is not properly installed. Try downloading the Oracle driver from tableau drivers page. If its installed correctly please cross check on the configurations you have provided. If you are using the ODBC driver, have you created the DSN properly. The DSN needs to be configured properly with the server name and authorisations and once this is done you can use this DSN in tableau.
Once you have installed the driver properly
Click Connect to Data.
On the Connect page, click Other Databases (ODBC).
In the DSN drop-down list, select the name that you gave to your Oracle BI Server ODBC connection, and then click Connect.
Below is the link on how to connect with the BI Connector
How to Connect to Oracle BI Server with Tableau without the shortcomings of Oracle ODBC driver
By Default, tableau server pre-populates “Server Run As user” account to Network Service account (NT AUTHRITY\NetworkService). And this account does not have full permission.

Resources