Class: ResultSet

$.db. ResultSet

$.db.ResultSet represents a database result set, which is generated during the execution of SQL statements.

new ResultSet()

Represents a database result set, which is generated during execution of SQL statements

Methods

close()

Closes the ResultSet
Throws:
  • Throws an error if the object the method is being called on is not valid.

getBigInt(columnIndex) → {ctypes.Int64}

Returns a ctypes.Int64 value of the specified column. getBigInt is used for BIGINT column types.
Parameters:
Name Type Description
columnIndex integer The target column, starting from 1
Throws:
Returns:
Type
ctypes.Int64

getBlob(columnIndex) → {ArrayBuffer}

Returns an ArrayBuffer value of the specified column. getBlob is used for BLOB column types.
Parameters:
Name Type Description
columnIndex integer The target column, starting from 1
Throws:
Returns:
Blob representation
Type
ArrayBuffer

getBString(columnIndex) → {ArrayBuffer}

Returns an ArrayBuffer object of the specified column. getBString is used for BINARY and VARBINARY column types.
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
  • Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
value ArrayBuffer object
Type
ArrayBuffer

getClob(columnIndex) → {string}

Returns a string value of the specified column. getClob is used for CLOB column types.
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
Returns:
String representation
Type
string

getDate(columnIndex) → {Date}

Used to retrieve the value of a DATE column in a ResultSet.
Parameters:
Name Type Description
columnIndex integer The index of the column in the result set starting from 1
Throws:
Returns:
A JavaScript Date object representing the value
Type
Date

getDecimal(columnIndex) → {number}

Returns a number value of the specified column. getDecimal is used for DECIMAL column types.
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
Returns:
Number representation
Type
number

getDouble(columnIndex) → {number}

Returns a number value of the specified column. getDouble is used for DOUBLE column types.
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
Returns:
Number representation
Type
number

getFloat(columnIndex) → {number}

Returns a number value of the specified column. getFloat is used for FLOAT column types.
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
Returns:
Number representation
Type
number

getInteger(columnIndex) → {integer}

Returns an integer value of the specified column, for TINYINT, SMALLINT, INT, and BIGINT column types. An exception is thrown if the value is bigger than 9007199254740992 (2^53) or smaller than -9007199254740992 (-2^53).
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
Returns:
Integer
Type
integer

getMetaData() → {$.db.ResultSetMetaData}

Returns the metadata of the result set
Returns:
The metadata of the result set
Type
$.db.ResultSetMetaData

getNClob(columnIndex) → {string}

Returns a string value of the specified column. getNClob is used for NCLOB and TEXT column types.
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
Returns:
String representation
Type
string

getNString(columnIndex) → {string}

Returns a string value of the specified column. getNString is used for NCHAR, NVARCHAR, SHORTTEXT column types.
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
Returns:
String representation
Type
string

getReal(columnIndex) → {number}

Returns a number value of the specified column. getReal is used for REAL column types.
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
Returns:
Number representation
Type
number

getSeconddate(columnIndex) → {Date}

Used to retrieve the value of a SECONDDATE column in a ResultSet.
Parameters:
Name Type Description
columnIndex integer The index of the column in the result set starting from 1
Throws:
Returns:
A JavaScript Date object representing the value
Type
Date

getString(columnIndex) → {string}

Returns a string value of the specified column. getString is used for CHAR and VARCHAR column types. ASCII only, not suitable for strings containing Unicode characters.
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
Returns:
String representation
Type
string

getText(columnIndex) → {string}

Returns a string value of the specified column. getText is used for TEXT column types.
Parameters:
Name Type Description
columnIndex integer The target column starting from 1
Throws:
Returns:
String representation
Type
string

getTime(columnIndex) → {Date}

Used to retrieve the value of a TIME column in a ResultSet.
Parameters:
Name Type Description
columnIndex integer The index of the column in the result set starting from 1
Throws:
Returns:
A JavaScript Date object representing the value
Type
Date

getTimestamp(columnIndex) → {Date}

Used to retrieve the value of a TIMESTAMP column in a ResultSet.
As this type contains only time information and no date, the JavaScript's date object will always be 1 Jan 1970 plus the time offset.
For example: if the stored value is 10:00:00, the JavaScript Date object will be: 1 Jan 1970 10:00:00.
Parameters:
Name Type Description
columnIndex integer The index of the column in the result set starting from 1
Throws:
Returns:
A JavaScript Date object representing the value
Type
Date

isClosed() → {boolean}

Checks if the ResultSet is closed.
Throws:
  • Throws an error if the object the method is being called on is not valid.
Returns:
Returns true if the ResultSet is already closed, false if not
Type
boolean

next() → {boolean}

Fetches the next row
Returns:
True if successful
Type
boolean