Clients - java.jdbc : JdbcClient

Represents the base JDBC Client

call

(string sqlQuery, typedesc[]? recordType, Param[] parameters)

returns table[] | () | Error

The call remote function implementation for JDBC client to invoke stored procedures/functions.

Parameters

  • sqlQuery string
  • The SQL stored procedure to execute

  • recordType typedesc[]?
  • Array of record types of the returned tables if there is any

  • parameters Param[]
  • The parameters to be passed to the procedure/function call. The number of parameters is variable

  • Return Type

    (table[] | () | Error)
  • A table[] if there are tables returned by the call remote function and else nil, Error will be returned if there is any error

select

(string sqlQuery, typedesc? recordType, Param[] parameters)

returns table | Error

The select remote function implementation for JDBC Client to select data from tables.

Parameters

  • sqlQuery string
  • SQL query to execute

  • recordType typedesc?
  • Type of the returned table

  • parameters Param[]
  • The parameters to be passed to the select query. The number of parameters is variable

  • Return Type

    (table | Error)
  • A table returned by the sql query statement else Error will be returned if there is any error

update

(string sqlQuery, Param[] parameters)

returns UpdateResult | Error

The update remote function implementation for JDBC Client to update data and schema of the database.

Parameters

  • sqlQuery string
  • SQL statement to execute

  • parameters Param[]
  • The parameters to be passed to the update query. The number of parameters is variable

  • Return Type

    (UpdateResult | Error)
  • A UpdateResult with the updated row count and key column values, else Error will be returned if there is any error

batchUpdate

(string sqlQuery, boolean rollbackAllInFailure, Param[] parameters)

returns BatchUpdateResult

The batchUpdate remote function implementation for JDBC Client to batch data insert.

Parameters

  • sqlQuery string
  • SQL statement to execute

  • rollbackAllInFailure boolean
  • If one of the commands in a batch update fails to execute properly, the JDBC driver may or may not continue to process the remaining commands in the batch. But this property can be used to override this behavior. If it is sets to true, if there is a failure in few commands and JDBC driver continued with the remaining commands, the successfully executed commands in the batch also will get rollback.

  • parameters Param[]
  • Variable number of parameter arrays each representing the set of parameters of belonging to each individual update

  • Return Type

    (BatchUpdateResult)
  • A BatchUpdateResult with the updated row count and returned error. If all the commands in the batch has executed successfully, the error will be nil. If one or more commands has failed, the returnedError field will give the correspoing JdbcClientError along with the int[] which conains updated row count or the status returned from the each command in the batch.