Author |
Message
|
vmurali_au |
Posted: Wed Sep 06, 2006 3:34 am Post subject: Exception executing SQL Query in Java Compute Node |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
I'm trying the following query
Quote: |
String strSymbolic = "ABCD";
selectQueryStr = "SET Environment.Variables.RESULTS[] = SELECT T2.STATE_INDEX_NM FROM Database.MBADMIN.SYMBOLIC_MST AS T1, Database.MBADMIN.STATE_INDEX_MST AS T2, Database.MBADMIN.SYMBOLIC_STATE_INDEX_ASSOC AS T3 WHERE T3.SYMBOLIC_ID = T1.SYMBOLIC_ID AND T3.STATE_INDEX_ID = T2.STATE_INDEX_ID AND T1.SYMBOLIC_NM = '"+ strSymbolic +"';";
state = createSQLStatement("WMBDB",selectQueryStr,MbSQLStatement.SQL_TRANSACTION_AUTO);
state.setThrowExceptionOnDatabaseError(true);
state.setTreatWarningsAsErrors(true);
state.select(contact admin,outAssembly); |
I'm getting the following exception after the select() statement
(com.ibm.broker.plugin.MbFatalException) <com.ibm.broker.plugin.MbFatalException class:JNI method:SqlStatementGroup::execute source:BIPv600 key:2488 >
After this exception my debugger just terminates.
I can very well execute this query in oracle command prompt (after removing "Database" and "AS" strings from the above query line)
I donno how to pinpoint the error. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Sep 06, 2006 4:14 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What happens when you run it from ESQL, instead of Java? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vmurali_au |
Posted: Wed Sep 06, 2006 5:09 am Post subject: |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
Jeff,
I tried the following in ESQL compute node
Quote: |
DECLARE strSymbolic CHAR 'ABCD';
SET Environment.Variables.RESULTS[] = SELECT T2.STATE_INDEX_NM FROM Database.MBADMIN.SYMBOLIC_MST AS T1, Database.MBADMIN.STATE_INDEX_MST AS T2, Database.MBADMIN.SYMBOLIC_STATE_INDEX_ASSOC AS T3 WHERE T3.SYMBOLIC_ID = T1.SYMBOLIC_ID AND T2.STATE_INDEX_ID = T3.STATE_INDEX_ID AND T1.SYMBOLIC_NM = strSymbolic; |
I got the result in Environment. No Exceptions.
I donno why i'm getting error in the Java Compute Node though as both have the same statements. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Sep 06, 2006 5:11 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Did you also set the properties of the Compute Node to Throw Exceptions on Database Error and Treat Warnings as Errors? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vmurali_au |
Posted: Wed Sep 06, 2006 5:21 am Post subject: |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
No. I've enabled "Throw Exception on Database Errors" in the Compute Node. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Sep 06, 2006 5:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Well, your Java code is setting Treat Warnings as Errors. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
dirac |
Posted: Wed Sep 06, 2006 5:46 am Post subject: |
|
|
Novice
Joined: 31 Mar 2005 Posts: 23
|
The 2488 in your error message refers to BIP2488
---------
BIP2488E: (insert1, insert2) Error detected whilst executing the SQL statement 'insert3'.
The message broker detected an error whilst executing the given statement. An exception has been thr
own to cut short the SQL program.
See the following messages for details of the error.
-----------
Which suggests that you are causing an SQL exception rather than a database problem... |
|
Back to top |
|
 |
vmurali_au |
Posted: Wed Sep 06, 2006 5:50 am Post subject: |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
But i donno how an SQL Exception is being caused as i'm not getting the Exception while executing SQL in ESQL Compute Node. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Sep 06, 2006 5:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You're probably getting an SQL Warning, that you have coded to instruct Broker to treat as an Error. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vmurali_au |
Posted: Wed Sep 06, 2006 7:35 am Post subject: |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
Jeff,
Even with "TreatWarningsAsErrors" turned to false in the Java Compute Node i'm getting the same Exception. |
|
Back to top |
|
 |
msukup |
Posted: Wed Sep 06, 2006 10:20 am Post subject: |
|
|
Acolyte
Joined: 11 Feb 2002 Posts: 56
|
vmurali,
please post the stack trace (in execution group's stderr file) as well as any entries written to syslog or event viewer. |
|
Back to top |
|
 |
|