Mysql Error handling
- Which of the following returns an SQLSTATE code?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The MySQL API call named ‘mysql_sqlstate()’ returns an SQLSTATE code. This SQLSTATE value is more ‘vendor neutral’ because it is based on the ‘ANSI SQL’ and ‘ODBC’ standards.
- The argument to the function mysql_error() is _______________.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The argument to the API functions ‘mysql_error()’, ‘mysql_errno()’ and ‘mysql_sqlstate()’ is a pointer to the connection handler. These should be called after an error occurs.
- What does mysql_real_connect() return if it fails?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The function ‘mysql_real_connect()’ must complete successfully before any other API functions that require a valid MYSQL connection handler structure can be executed. It return NULL on failure.
- The function load_defaults() reads the option files.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The function named ‘load_defaults()’ reads the option files. It takes four arguments. It does not pick up values from the environment settings. All connection paremeters can be brought to argument vector.
- The –protocol value ‘TCP’ runs on which operating systems?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The connection protocol used by the option ‘–protocol = TCP’ indicates TCP/IP connection to the local or the remote server. Each –protocol value has the set of permissible OS.