Connectors of ballerina.data.sql package
connector ClientConnector (string dbType, string hostOrPath, int port, string dbName, string username, string password, ConnectionProperties options)
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
dbType | string | |
hostOrPath | string | |
port | int | |
dbName | string | |
username | string | |
password | string | |
options | ConnectionProperties |
action batchUpdate()
The call action implementation for SQL connector.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
parameters | Parameter[][] | Parameter array |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
int[] | updatedCounts: Array of update counts |
action call()
The call action implementation for SQL connector.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
parameters | Parameter[] | Parameter array |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
datatable | Result set for the query |
action close()
The close action implementation for SQL connector.
Parameters:
Parameter Name | Data Type | Description |
---|
action select()
The select action implementation for SQL connector.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
parameters | Parameter[] | Parameter array |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
datatable | Result set for the query |
action update()
The update action implementation for SQL connector.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
parameters | Parameter[] | Parameter array |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
int | integer: Updated row count |
action updateWithGeneratedKeys()
The update with generated keys given columns action implementation for SQL connector.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
parameters | Parameter[] | Parameter array |
keyColumns | string[] | String array |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
int | rowCount: Updated row count | |
string[] | rowCount: Updated row count |
Structs of ballerina.data.sql package
struct ConnectionProperties
Fields:
Field Name | Data Type | Description |
---|---|---|
url | string | Platform independent DB access URL |
dataSourceClassName | string | Name of the DataSource class provided by the JDBC driver |
username | string | Default authentication username used when obtaining Connections from the underlying driver |
password | string | Default authentication password used when obtaining Connections from the underlying driver |
connectionTestQuery | string | Query that will be executed to validate that the connection to the database is still alive |
poolName | string | User-defined name for the connection pool and appears mainly in logging |
catalog | string | Catalog of connections created by this pool |
connectionInitSql | string | SQL statement that will be executed after every new connection creation before adding it to the pool |
driverClassName | string | Fully qualified Java class name of the JDBC driver to be used |
transactionIsolation | string | Transaction isolation level of connections returned from the pool. The supported values are TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ and TRANSACTION_SERIALIZABLE |
autoCommit | boolean | Auto-commit behavior of connections returned from the pool |
isolateInternalQueries | boolean | Determines whether HikariCP isolates internal pool queries, such as the connection alive test, in their own transaction |
allowPoolSuspension | boolean | Whether the pool can be suspended and resumed through JMX |
readOnly | boolean | Whether Connections obtained from the pool are in read-only mode by default |
maximumPoolSize | int | Maximum size that the pool is allowed to reach, including both idle and in-use connections |
connectionTimeout | int | Maximum number of milliseconds that a client will wait for a connection from the pool |
idleTimeout | int | Maximum amount of time that a connection is allowed to sit idle in the pool |
minimumIdle | int | Minimum number of idle connections that pool tries to maintain in the pool |
maxLifetime | int | Maximum lifetime of a connection in the pool |
validationTimeout | int | Maximum amount of time that a connection will be tested for aliveness |
leakDetectionThreshold | int | Amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak |
datasourceProperties | map | Data source specific properties which are used along with the dataSourceClassName |
struct Parameter
Fields:
Field Name | Data Type | Description |
---|---|---|
sqlType | string | |
value | any | |
direction | int | |
structuredType | string |