camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Miles (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-6091) Improvement to SqlProducer class
Date Wed, 20 Feb 2013 15:23:12 GMT
Chris Miles created CAMEL-6091:
----------------------------------

             Summary: Improvement to SqlProducer class
                 Key: CAMEL-6091
                 URL: https://issues.apache.org/jira/browse/CAMEL-6091
             Project: Camel
          Issue Type: Improvement
          Components: camel-sql
    Affects Versions: 2.10.3
            Reporter: Chris Miles
            Priority: Minor
             Fix For: Future


I have came across a bug with the Microsoft SQL Server driver (4.0) in where the folowing
line is problematic:

int expected = ps.getParameterMetaData().getParameterCount();

If I run the following query through the component:

INSERT INTO [NEW_TABLE] SELECT * FROM [OLD_TABLE] WHERE ID = #

expected is set to 0 which results in my value not being set.

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The value is not set for the parameter
number 1.

While this is a SQL Server issue, unfortunately the source is not available and an update
is not likely any time soon to return the correct meta data. It would be handy if this Producer
put the query preperation a little more into the hands of the user. I.e. let me say there
are 5 parameters to be prepared along with the 5 values to use.

If the user has manually put 5 items in a Map in the body, then can we not just use the map
length to identify how many values and then iterate them.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message