on 09-10-2008 6:12 AM
Normally after a call to the 'SQLDBC_Connection_connect' function we check for the possible errors by calling the
SQLDBC_ErrorHndl *errHndl = SQLDBC_Connection_getError(conn);
SQLDBC_ErrorHndl_getErrorText(errHndl); or SQLDBC_ErrorHndl_getErrorText(errHndl);
Should we be doing the same after the following calls too ? They all take 'SQLDBC_Connection*' as a parameter just like 'SQLDBC_Connection_connect' . In other words the question is is the SQLDBC_Connection object set with the error information (if any) in case any of the following call fails?
SQLDBC_Connection_createStatement
SQLDBC_Connection_close
SQLDBC_Connection_setAutoCommit
SQLDBC_Connection_commit
SQLDBC_Connection_releaseStatement
SQLDBC_Connection_close
Please advise.
Regards
Raj
Hello Raj
Usually checking the error is sensible, if the method in question returns a value of type SQLDBC_Retcode.
However, createStatement sets a memory allocation error, if no statement could be generated due to memory restrictions and therefore a NULL would be returned.
Regards Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
So, the conclusion is SQLDBC_Connection object is set with error information (if any) in case, any of the following call fails.
SQLDBC_Retcode SQLDBC_Connection_close
SQLDBC_Retcode SQLDBC_Connection_commit
SQLDBC_Retcode SQLDBC_Connection_rollback
And it is better to check for the errors.
Regards
Raja
User | Count |
---|---|
79 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.