Mysql Error handling
- All API calls return a value.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
In MySQL, not all the API calls return a value. The client routine named ‘mysql_close()’ is one that does not. The API calls that return a value are ‘mysql_sqlstate()’, ‘mysql_error()’ etc.
- 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.
- 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.
- 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 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.