databaseManager.getDataSetByQuery

how can I capture the exception after a databaseManager.getDataSetByQuery() to display it in a global var or message window other than the ugly generic insult?
if I issue a plugins.rawSQL.getException() after a rawSQL command, it works, but for some reason when using databaseManager.getDataSetByQuery, it stops there… and I see no way to return the SQL error. and what is the object the servoyexception if linked to?

Hi Lesouef,

The returned dataset object holds any exception info returned from the database.
Using myReturnedDataSet.getException() you get a ServoyException object back. See the Solution Explorer tree for more info.

no luck, the method stops there, the dataset is not created at all (sql syntax error from odbc driver returned in the console only)

What SQL error is this ?

a SQL syntax error reported by the odbc driver, I’d like to put it on user’s screen.

Sounds to me that the ODBC driver is not playing nice. It should send the exception to the client (i.e. Servoy).
What ODBC driver is this ? And what JDBC-to-ODBC driver do you use ?

JDBC-to-ODBC ? the one which comes with servoy…
the odbc driver itself is IBM client access, but the error is returned, otherwise servoy would not show it in the console
what I want is grab it to display it

lesouef:
JDBC-to-ODBC ? the one which comes with servoy…

Okay, this is the Sun JVM built-in driver (FYI, this driver is not implemented in the Mac JVM (blame Apple)).

lesouef:
the odbc driver itself is IBM client access, but the error is returned, otherwise servoy would not show it in the console
what I want is grab it to display it

I guess you need to use a TRY/CATCH block then to catch any errors that are not handled by the databaseManager.

try
{
    // your code
} catch(err) {
    application.output(err.message) ;// the error message
}

Perhaps you want to file a case in Servoy’s support system to catch these exceptions in the databaseManager.

it does, great point.
but where is this try/catch thing from? actually, I shoud say when do you know whether a std js command is supported or not?

lesouef:
but where is this try/catch thing from? actually, I shoud say when do you know whether a std js command is supported or not?

I think in general you can consider anything that isn’t webbrowser (DOM) specific javascript syntax compatible for use in Servoy.