hanaml.ConnectionContext {hana.ml.r}R Documentation

ConnectionContext

Description

Represents a connection to a HANA system. ConnectionContext includes methods for creating DataFrames from data on HANA. DataFrames are tied to a ConnectionContext, and are unusable once their ConnectionContext is closed.

Usage

hanaml.ConnectionContext(dsn,
                         username,
                         password,
                         odbc = TRUE,
                         jdbcDriver = NULL,
                         ...)

Arguments

dsn

character
A registered data source name for ODBC or <host>:<port> for JDBC.

username

character
User id.

password

character
Password.

odbc

logical
Use ODBC or JDBC. Defaults to TRUE.

jdbcDriver

character
Path to JDBC driver. Only valid for JDBC.

Format

R6Class object.

Value

Object of R6Class with methods for ConnectionContext

Methods

close()

Closes the existing connection.
Usage: conn$close()

sql()

Returns a DataFrame representing a query.

Usage: df <- conn$sql('SELECT T.A, T2.B FROM T, T2 WHERE T.C=T2.C') Arguments:

Returns: DataFrame Dataframe for the query.

GetCurrentSchema()

Returns the name of current working schema in the database.

Usage: dataframe$GetCurrentSchema()
Returns: character
Current schema name.

table()

Returns a DataFrame representing a table.

Usage: df1 <- conn$table('MY_TABLE')
df2 <- conn$table('MY_OTHER_TABLE', schema='MY_SCHEMA') Arguments:

Returns: DataFrame Dataframe selecting data from that table.


[Package hana.ml.r version 1.0.8 Index]