Hitachi

Hitachi Advanced Database Application Development Guide


19.2.2 a_rdb_SQLConnect() (establish a connection)

Organization of this subsection

(1) Function

This CLI function establishes a connection with the HADB server.

(2) Format

signed short a_rdb_SQLConnect
(
  void                          *ConnectionHandle,   /* In */
  char                          *UserID,             /* In */
  char                          *Password,           /* In */
  a_rdb_SQLResultInfo_t         *ResultInfo,         /* In */
  void                          *Option              /* In */
)

(3) Arguments

ConnectionHandle

Specifies a connection handle.

UserID

Specifies the authorization identifier to be used to connect to the HADB server, as a character string in C or C++.

Password

Specifies the password for the authorization identifier that was specified for UserID, in the representation of a character string in C or C++ language.

For details about the rules for passwords, see Specification format and rules for the CREATE USER statement in the manual HADB SQL Reference.

ResultInfo

Specifies for each CLI function the address where the SQL results information is to be stored. SQL results information is returned to the specified area until a_rdb_SQLDisconnect() is issued.

If the specified address is NULL, SQL results information is not returned.

For details about the a_rdb_SQLResultInfo_t structure, see 19.7.6 a_rdb_SQLResultInfo_t structure (SQL results information).

Option

Specifies NULL.

(4) Return value

  1. If a_rdb_SQLConnect() terminates normally, a_rdb_RC_SQL_SUCCESS is returned.

  2. If the connection is established successfully, but the disk containing server message log files or client message log files has become full, a_rdb_RC_SQL_WARNING is returned.

  3. If an error occurs while messages cannot be output to the client message log file, the error cause code is returned. For details about the error cause code, see 19.8 Return values of the CLI functions.

(5) Notes

a_rdb_SQLConnect() cannot be executed in the following cases: