Namespace: hdb

$. hdb

This namespace provides means for seamless HANA database access. It is intended to be a replacement of the older $.db namespace. Fundamental goal of the new interface is to ensure simplicity, convenience, completeness and performance.

Classes

ColumnMetadata
Connection
ProcedureResult
ResultSet
ResultSetIterator
ResultSetMetaData
SQLException

Members

<static> isolation

Constants that represent the isolation levels for a transaction
Properties:
Name Type Default
READ_COMMITTED number 2
REPEATABLE_READ number 4
SERIALIZABLE number 8

<static> types

Set of constants of the database column types. The JavaScript Type column below describes the implicit Database to JavaScript type convertions performed by the $.hdb API

Name Value JavaScript Type Comment
TINYINT 1 Number
SMALLINT 2 Number
INTEGER 3 Number
BIGINT 4 ctypes.Int64
DECIMAL 5 String
REAL 6 Number
DOUBLE 7 Number
CHAR 8 String
VARCHAR 9 String
NCHAR 10 String
NVARCHAR 11 String
BINARY 12 ArrayBuffer
VARBINARY 13 ArrayBuffer
DATE 14 Date
TIME 15 Date
TIMESTAMP 16 Date
CLOB 25 String
NCLOB 26 String
BLOB 27 ArrayBuffer
SMALLDECIMAL 47 String
TEXT 51 ArrayBuffer
SHORTTEXT 52 String
ALPHANUM 55 String
SECONDDATE 62 Date
ST_GEOMETRY 74 ArrayBuffer consider using SQL's ST_asGeoJSON() on ST_GEOMETRY columns for easy consumption
ST_POINT 75 ArrayBuffer consider using SQL's ST_asGeoJSON() on ST_POINT columns for easy consumption

Methods

<static> getConnection(options) → {$.hdb.Connection}

Returns a database connection.
Parameters:
Name Type Argument Description
options object <optional>
object specifying the options:
  • isolationLevel - transaction isolation level. Default is $.hdb.isolation.READ_COMMITTED
  • sqlcc - absolute or relative path to xssqlcc file
  • pool - boolean option useful to require pooled connection in order to maximize performance. Please note that connection pooling works only in combination with xssqlcc.
  • treatDateAsUTC - if true, all Date objects passed to/returned by the API will be treated as UTC(milliseconds since epoch). If false, Date objects are directly processed in local system time.
Returns:
Connection - The internal connection to the database with the user of the current session.
Type
$.hdb.Connection
Example
var connection = $.hdb.getConnection({"isolationLevel": $.hdb.isolation.REPEATABLE_READ, "sqlcc": "package::mysqlccfile"});

// Get connection from automatically created sqlcc pool
var connection = $.hdb.getConnection({"sqlcc": "package::mysqlccfile", "pool": true});