openGauss Development Process

·

2 min read

Figure 1 ODBC-based application development process

APIs Involved in the Development Process

Table 1 API description

FunctionAPI
Allocate a handleSQLAllocHandle is a generic function for allocating a handle. It can replace the following functions:
Set environment attributesSQLSetEnvAttr
Set connection attributesSQLSetConnectAttr
Set statement attributesSQLSetStmtAttr
Connect to a data sourceSQLConnect
Bind a buffer to a column in the result setSQLBindCol
Bind the parameter marker of an SQL statement to a bufferSQLBindParameter
Return the error message of the last operationSQLGetDiagRec
Prepare an SQL statement for executionSQLPrepare
Run a prepared SQL statementSQLExecute
Run an SQL statement directlySQLExecDirect
Fetch the next row (or rows) from the result setSQLFetch
Return data in a column of the result setSQLGetData
Get the column information from a result setSQLColAttribute
Disconnect from a data sourceSQLDisconnect
Release a handleSQLFreeHandle is a generic function for releasing a handle. It can replace the following functions:

NOTE:
If an execution request (not in a transaction block) received in the database contains multiple statements, the request is packed into a transaction. If one of the statements fails, the entire request will be rolled back.

警告:

ODBC is the central layer of the application program and the database. It is responsible for transmitting the SQL instructions issued by the application program to the database, and does not parse the SQL syntax by itself. Therefore, when an SQL statement with confidential information (such as a plaintext password) is written in an application, the confidential information will be exposed in the driver log.