[mule-user] Problem calling sybase stored procedure with jdbc connector

2 views
Skip to first unread message

RonanL

unread,
Nov 21, 2008, 11:47:23 AM11/21/08
to us...@mule.codehaus.org

Hello.

I'm trying to call a simple stored procedure using the 2.0.2 community
edition jdbc connector.

Here's my mule config: http://www.nabble.com/file/p20625045/mule-config.xml
mule-config.xml

I'm getting the following error when the stored proc runs:

[21 Nov 2008 16:34:17] [ERROR][jdbcConnector.receiver.1]
org.mule.DefaultExceptionStrategy - Caught exception in Exception Strategy:
Incorrect syntax near '20'.
Query: call prc_sel_pub_tbl(20) Parameters: []
java.sql.SQLException: Incorrect syntax near '20'.
Query: call prc_sel_pub_tbl(20) Parameters: []
at org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:359)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:240)
at
org.mule.transport.jdbc.JdbcMessageReceiver.getMessages(JdbcMessageReceiver.java:195)
at
org.mule.transport.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:136)
at
org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:47)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Unknown Source)

Any ideas?

Thanks,

Ronan
--
View this message in context: http://www.nabble.com/Problem-calling-sybase-stored-procedure-with-jdbc-connector-tp20625045p20625045.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Antoine Borg

unread,
Nov 24, 2008, 3:08:46 AM11/24/08
to us...@mule.codehaus.org
Hi,

The main error seems to be: "Incorrect syntax near '20'" so my guess is that
the parameter is causing problems.

Have you tried using parameters on the endpoints instead?

A


Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
email: antoin...@ricston.com | blog: blog.ricston.com | web: ricston.com

RonanL

unread,
Nov 24, 2008, 4:02:39 AM11/24/08
to us...@mule.codehaus.org

Hey Antoine.

No, I haven't tried parameters, chiefly because I don't know how!!

What is the correct syntax for specifying parameters in the config?

Thanks,

Ronan

--
View this message in context: http://www.nabble.com/Problem-calling-sybase-stored-procedure-with-jdbc-connector-tp20625045p20657074.html

Antoine Borg

unread,
Nov 25, 2008, 2:55:47 AM11/25/08
to us...@mule.codehaus.org

RonanL

unread,
Nov 25, 2008, 4:57:52 AM11/25/08
to us...@mule.codehaus.org

Hi Antoine.

I tried making the changes you suggested - see attached mule-config:
http://www.nabble.com/file/p20678125/mule-config.xml mule-config.xml

I'm still getting errors:

[25 Nov 2008 09:33:30] [ERROR][jdbcConnector.receiver.1]


org.mule.DefaultExceptionStrategy - Caught exception in Exception Strategy:

Incorrect syntax near '#'.
Query: CALL prc_sel_pub_tbl(#[map-payload:value]) Parameters: []
java.sql.SQLException: Incorrect syntax near '#'.
Query: CALL prc_sel_pub_tbl(#[map-payload:value]) Parameters: []


at org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:359)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:240)
at
org.mule.transport.jdbc.JdbcMessageReceiver.getMessages(JdbcMessageReceiver.java:195)
at

org.mule.transport.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:136)


at
org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:47)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at

edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Unknown Source)

This looks like a different issue, because the value isn't being
substituted, but I doubt it would work even if it was. The dbutils
QueryRunner class that is being called under the covers is using a
preparedStatement to query the database. I could be wrong, but I thought
stored procedures were called using the callableStatement class?

Thanks,

Ronan

--
View this message in context: http://www.nabble.com/Problem-calling-sybase-stored-procedure-with-jdbc-connector-tp20625045p20678125.html

Antoine Borg

unread,
Dec 3, 2008, 5:36:08 AM12/3/08
to us...@mule.codehaus.org
Hi,

Can you try with Mule 2.1.1? I think there were some improvements made to
the parameter handling mechanism

A


Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
email: antoin...@ricston.com | blog: blog.ricston.com | web: ricston.com

-----Original Message-----
From: RonanL [mailto:ronan....@fmr.com]
Sent: Tuesday, November 25, 2008 10:58 AM
To: us...@mule.codehaus.org
Subject: RE: [mule-user] Problem calling sybase stored procedure with jdbc
connector


Hi Antoine.

I tried making the changes you suggested - see attached mule-config:
http://www.nabble.com/file/p20678125/mule-config.xml mule-config.xml

I'm still getting errors:

[25 Nov 2008 09:33:30] [ERROR][jdbcConnector.receiver.1]
org.mule.DefaultExceptionStrategy - Caught exception in Exception Strategy:
Incorrect syntax near '#'.
Query: CALL prc_sel_pub_tbl(#[map-payload:value]) Parameters: []
java.sql.SQLException: Incorrect syntax near '#'.
Query: CALL prc_sel_pub_tbl(#[map-payload:value]) Parameters: []
at
org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:359)
at
org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:240)
at

org.mule.transport.jdbc.JdbcMessageReceiver.getMessages(JdbcMessageReceiver.
java:195)
at
org.mule.transport.TransactedPollingMessageReceiver.poll(TransactedPollingMe

ssageReceiver.java:136)
at
org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:47)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at

edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1061)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run

(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Unknown Source)

This looks like a different issue, because the value isn't being

Thanks,

Ronan

> a:47)
>> at org.mule.work.WorkerContext.run(WorkerContext.java:310)
>> at
>> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.run
>> W
>> orker(
>> ThreadPoolExecutor.java:1061)
>> at
>> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
>> k

RonanL

unread,
Dec 3, 2008, 6:00:23 AM12/3/08
to us...@mule.codehaus.org

Hey Antoine.

I've moved away from using the jdbc connector entirely. I'm now using quartz
to fire trigger an event which kicks off a spring jdbc based component. It's
working well, so I'm happy with that.

If I get a chance, I'll go back and look at mule 2.1.1, but I can't see that
happening in the next week or so.

Thanks for getting back to me.

Ronan

--
View this message in context: http://www.nabble.com/Problem-calling-sybase-stored-procedure-with-jdbc-connector-tp20625045p20810808.html

Reply all
Reply to author
Forward
0 new messages