Hello everyone,

I'm using ND5, NT4, SP4 with a Sybase database.

In my code, I need to check to be sure that the results I retrieve from my EJB
actually executed successfully. I am using the following to do that check:

/***** Begin Code Snippet *****/

CSpServerObject _iface =
(CSpServerObject)CSpider.getDataObject("daoMasterFileSearchBL");
// Retrieve the bean function we want to use and execute it.
CSpServerMethod meth = _iface.getServerMethod("getEntityListBL");
meth.clearAllCachedData();
meth.setValue("p_iAppID", new CSpInteger(_iAppID));
meth.execute();
CSpDBResult resResult =
(CSpDBResult)((CSpAnyObject)meth.getReturnValue()).get();

if (resResult.getResultStatus().getErrorCode() != CSpDBResultStatus.SUCCESS)
{
     // Do some stuff here to handle the problem...
}
else
{
     // Proceed normally.
}

/***** End Code Snippet *****/


The Bean method getEntityListBL() simply performs an executeImmediate on a
generated SQL statement.

When everything works properly and I get the results I expect back from the
bean, resResult.getResultStatus().getErrorCode() translates to a value of 9.

However, CSpDBResult.SUCCESS translates to a value of 0. Am I making the wrong
comparison to determine if the executeImmediate() was successful, or have I
missed something else here?

Thanks in advance for any insight,
Beth


-------------------------------------------------------------------------
Beth Elicia Finn                              Competitive Media Reporting
Applications Developer                              1385 Enterprise Drive
[EMAIL PROTECTED]                                      West Chester, PA 19380
http://www.cmr.com/                                        (610) 430-6404


_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to