Ballerina API Documentation

Connectors of ballerina.data.sql package

connector ClientConnector (string dbType, string hostOrPath, int port, string dbName, string username, string password, ConnectionProperties options)

Parameters:

Parameter NameData TypeDescription
dbTypestring
hostOrPathstring
portint
dbNamestring
usernamestring
passwordstring
optionsConnectionProperties

Actions:

action batchUpdate()

The call action implementation for SQL connector.

Parameters:

Parameter NameData TypeDescription
parametersParameter[][]Parameter array

Return Parameters:

Return VariableData TypeDescription
int[]updatedCounts: Array of update counts

action call()

The call action implementation for SQL connector.

Parameters:

Parameter NameData TypeDescription
parametersParameter[]Parameter array

Return Parameters:

Return VariableData TypeDescription
datatableResult set for the query

action close()

The close action implementation for SQL connector.

Parameters:

Parameter NameData TypeDescription

action select()

The select action implementation for SQL connector.

Parameters:

Parameter NameData TypeDescription
parametersParameter[]Parameter array

Return Parameters:

Return VariableData TypeDescription
datatableResult set for the query

action update()

The update action implementation for SQL connector.

Parameters:

Parameter NameData TypeDescription
parametersParameter[]Parameter array

Return Parameters:

Return VariableData TypeDescription
intinteger: Updated row count

action updateWithGeneratedKeys()

The update with generated keys given columns action implementation for SQL connector.

Parameters:

Parameter NameData TypeDescription
parametersParameter[]Parameter array
keyColumnsstring[]String array

Return Parameters:

Return VariableData TypeDescription
introwCount: Updated row count
string[]rowCount: Updated row count


Structs of ballerina.data.sql package

struct ConnectionProperties

Fields:

Field NameData TypeDescription
urlstringPlatform independent DB access URL
dataSourceClassNamestringName of the DataSource class provided by the JDBC driver
usernamestringDefault authentication username used when obtaining Connections from the underlying driver
passwordstringDefault authentication password used when obtaining Connections from the underlying driver
connectionTestQuerystringQuery that will be executed to validate that the connection to the database is still alive
poolNamestringUser-defined name for the connection pool and appears mainly in logging
catalogstringCatalog of connections created by this pool
connectionInitSqlstringSQL statement that will be executed after every new connection creation before adding it to the pool
driverClassNamestringFully qualified Java class name of the JDBC driver to be used
transactionIsolationstringTransaction isolation level of connections returned from the pool. The supported values are TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ and TRANSACTION_SERIALIZABLE
autoCommitbooleanAuto-commit behavior of connections returned from the pool
isolateInternalQueriesbooleanDetermines whether HikariCP isolates internal pool queries, such as the connection alive test, in their own transaction
allowPoolSuspensionbooleanWhether the pool can be suspended and resumed through JMX
readOnlybooleanWhether Connections obtained from the pool are in read-only mode by default
maximumPoolSizeintMaximum size that the pool is allowed to reach, including both idle and in-use connections
connectionTimeoutintMaximum number of milliseconds that a client will wait for a connection from the pool
idleTimeoutintMaximum amount of time that a connection is allowed to sit idle in the pool
minimumIdleintMinimum number of idle connections that pool tries to maintain in the pool
maxLifetimeintMaximum lifetime of a connection in the pool
validationTimeoutintMaximum amount of time that a connection will be tested for aliveness
leakDetectionThresholdintAmount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak
datasourcePropertiesmapData source specific properties which are used along with the dataSourceClassName

struct Parameter

Fields:

Field NameData TypeDescription
sqlTypestring
valueany
directionint
structuredTypestring


Menu

  • Connectors
    • ClientConnector (string dbType, string hostOrPath, int port, string dbName, string username, string password, ConnectionProperties options)
      • batchUpdate(Parameter[][] parameters)
      • call(Parameter[] parameters)
      • close()
      • select(Parameter[] parameters)
      • update(Parameter[] parameters)
      • updateWithGeneratedKeys(Parameter[] parameters, string[] keyColumns)
  • Structs
    • ConnectionProperties
    • Parameter

Copyright 2017 Ballerina API Documentation