Thanks. I am trying to get the generated id after insert, I'm using derby, with 
'values IDENTITY_VAL_LOCAL()' in a second sql but doesn't work, are these 
incompatible functions ?
 
2008-10-01 13:47:14,790 [169.254.7.221-WH24CU6052] [jms-Worker-1] ERROR 
DBReportMediator Error execuring insert statement : values IDENTITY_VAL_LOCAL() 
against DataSource : jdbc:derby://localhost:1527/esbdb;create=false
java.sql.SQLException: The column position '1' is out of range.  The number of 
columns for this ResultSet is '0'.
        at 
org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.client.am.SqlException.getSQLException(Unknown 
Source)
        at org.apache.derby.client.am.ColumnMetaData.getColumnType(Unknown 
Source)
 
the insert statement alone works though.
 
here dbreport config, for the moment I assign value 1 to test it out:
 
<syn:dbreport>
            <syn:connection>
                <syn:pool>
                    <syn:driver>org.apache.derby.jdbc.ClientDriver</syn:driver>
                    <syn:password>esb</syn:password>
                    <syn:user>esb</syn:user>
                    
<syn:url>jdbc:derby://localhost:1527/esbdb;create=false</syn:url>
                </syn:pool>
            </syn:connection>
            <syn:statement>
                <syn:sql><![CDATA[insert into sample values (DEFAULT, 
?)]]></syn:sql>
                <syn:parameter xmlns:ns1=" http://org.apache.synapse/xsd"; 
xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/"; expression="//*/*" 
type="VARCHAR"/>
            </syn:statement>
            <syn:statement>
                <syn:sql><![CDATA[values IDENTITY_VAL_LOCAL()]]></syn:sql>
                <syn:parameter value="1" type="INTEGER"/>
            </syn:statement>
        </syn:dbreport>
 
remsy

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Indika Kumara
Sent: October 1, 2008 1:21 PM
To: [email protected]
Subject: Re: [esb-java-user] dbreport question



Hi Remsy

All the samples in [1] show a scenario somewhat similar to your scenario (I 
believe). In those samples, get an ID from DB and set it as message context 
property 
and then perform conditional switching based on the value of that property. On 
the out path, some result form response is stored in the DB too.  
By going through [2], it will be easy to understand the current behavior of the 
DB -mediators
 

[1] http://wso2.org/project/esb/java/1.7.1/docs/ESB_Samples.html#DBMediators

[2] 
http://wso2.org/project/esb/java/1.7.1/docs/ESB_Configuration_Language.html#dblookup
 


Thanks
Indika


Schmilinsky, Remsy wrote: 

I need ro propagate the result of a query (id number) from dbreport to the 
mediators along with the message. 



The idea is that the mediators will perform some actions on the message and 
then log results in the db, so we need the id to reference the original data.



is this possible ? how ?



thanks



Remsy



_______________________________________________

Esb-java-user mailing list

[email protected]

http://mailman.wso2.org/cgi-bin/mailman/listinfo/esb-java-user


  _____  



No virus found in this incoming message.

Checked by AVG -  http://www.avg.com 

Version: 8.0.173 / Virus Database: 270.7.5/1698 - Release Date: 9/29/2008 7:25 
PM



  


_______________________________________________
Esb-java-user mailing list
[email protected]
http://mailman.wso2.org/cgi-bin/mailman/listinfo/esb-java-user

Reply via email to