Skip to main content

%XDBC.Gateway.JDBC.Statement

class %XDBC.Gateway.JDBC.Statement extends %XDBC.Gateway.Statement

FOR INTERNAL USE - do not invoke directly

Property Inventory

Method Inventory

Parameters

parameter CLOSEALLRESULTS = 3;
parameter CLOSECURRENTRESULT = 1;
parameter EXECUTEFAILED = -3;
parameter KEEPCURRENTRESULT = 2;
parameter NOGENERATEDKEYS = 2;
parameter RETURNGENERATEDKEYS = 1;
parameter SUCCESSNOINFO = -2;

Properties

property connection as %XDBC.Gateway.JDBC.Connection;
Property methods: connectionGet(), connectionGetSwizzled(), connectionIsValid(), connectionNewObject(), connectionSet()
property statement as %ObjectHandle;
Property methods: statementGet(), statementIsValid(), statementSet()

Methods

method %OnNew(connection As %XDBC.Gateway.JDBC.Connection, statement As %ObjectHandle) as %Status
Inherited description: This callback method is invoked by the %New() method to provide notification that a new instance of an object is being created.

If this method returns an error then the object will not be created.

It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:

Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.

method AddBatch(sql As %String)
Sets the value of the designated parameter with the given object. Method SetObject(parameterName As %String, parameter As %ObjectHandle) {} Adds the given SQL command to the current list of commmands for this Statement object.
method Cancel()
Cancels this Statement object if both the DBMS and driver support aborting an SQL statement.
method ClearBatch()
Empties this Statement object's current list of SQL commands.
method Close()
Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.
method Execute(sql As %String, autoGeneratedKeys As %Integer = "") as %Boolean
Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval xecutes the given SQL statement, which may return multiple results. In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string. The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s). Note:This method cannot be called on a PreparedStatement or CallableStatement.
method ExecuteBatch() as %Library.ListOfDataTypes
Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts
method ExecuteQuery(sql As %String) as ResultSet
list of int Executes the given SQL statement, which returns a single ResultSet object
method ExecuteUpdate(sql As %String, autoGeneratedKeys As %Integer = 0) as %Integer
Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval. Cannot be executed on PreparedStatement or CallableStatement.
method GetConnection() as Connection
Retrieves the Connection object that produced this Statement object
method GetFetchSize() as %Integer
Retrieves the number of result set rows that is the default fetch size for ResultSet objects generated from this Statement object
method GetGeneratedKeys() as ResultSet
Retrieves any auto-generated keys created as a result of executing this Statement object
method GetMaxFieldSize() as %Integer
Retrieves the maximum number of bytes that can be returned for character and binary column values in a ResultSet object produced by this Statement object
method GetMaxRows() as %Integer
Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain
method GetMoreResults(option As %Integer) as %Boolean
Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) obtained with the method getResultSet.
method GetQueryTimeout() as %Integer
Retrieves the number of seconds the driver will wait for a Statement object to execute.
method GetResultSet() as ResultSet
Retrieves the current result as a ResultSet object.
method GetUpdateCount() as %Integer
Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned
method IsClosed() as %Boolean
Retrieves whether this Statement object has been closed
method SetFetchSize(rows As %Integer)
Gives the driver a hint as to the number of rows that should be fetched from the database when more rows are needed for ResultSet objects genrated by this Statement.
method SetMaxFieldSize(max As %Integer)
Sets the limit for the maximum number of bytes that can be returned for character and binary column values in a ResultSet object produced by this Statement object.
method SetMaxRows(max As %Integer)
Sets the limit for the maximum number of rows that any ResultSet object generated by this Statement object can contain to the given number.
method SetQueryTimeout(seconds As %Integer)
Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.

Inherited Members

Inherited Methods

Subclasses

FeedbackOpens in a new tab