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_COMMITTEDnumber 2 REPEATABLE_READnumber 4 SERIALIZABLEnumber 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 TINYINT1 Number SMALLINT2 Number INTEGER3 Number BIGINT4 ctypes.Int64 DECIMAL5 String REAL6 Number DOUBLE7 Number CHAR8 String VARCHAR9 String NCHAR10 String NVARCHAR11 String BINARY12 ArrayBuffer VARBINARY13 ArrayBuffer DATE14 Date TIME15 Date TIMESTAMP16 Date CLOB25 String NCLOB26 String BLOB27 ArrayBuffer SMALLDECIMAL47 String TEXT51 ArrayBuffer SHORTTEXT52 String ALPHANUM55 String SECONDDATE62 Date ST_GEOMETRY74 ArrayBuffer consider using SQL's ST_asGeoJSON() on ST_GEOMETRY columns for easy consumption ST_POINT75 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 optionsobject <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});