Description Usage Arguments Details Value
Establish a connection to a JDBC or PostgreSQL database, and return that value in order to query the database.
1 | redhat_db_conn(filename, instance, env.passname)
|
filename |
the location of the database config file. Should contain the scheme, host, port, database (if applicable), classname, jars, and user. Password will be prompted. |
instance |
if the config file has multiple instances in it (e.g. production and development), specific which instance to connect to. |
env.passname |
the name of the environment variable that is storing the
obscured password. Create this using |
This function requires the user to have access to the database, have downloaded the driver, and set up the certificates on their computer. The process for using the package is to create a config file, then pass it along with the path:
vdm.conn <- redhat_db_conn("~/.vdm.cfg")
sales.conn <- redhat_db_conn("~/.sales.cfg")
Then, the created connection can be used with the DBI package:
DBI::dbGetQuery(vdm.conn, "SELECT id FROM APL_CEE_VDM.stg_gss_case LIMIT 10")
DBI::dbGetQuery(sales.conn, "SELECT unique_identifier FROM
rsds_ops_clv.customer_timeline_oracle_18q1 WHERE unique_identifier != '' LIMIT 10")
redhat_db_conn returns a database connection that can be used for SQL queries
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.