ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abhigyan Agrawal1 <abhigyan_agra...@in.ibm.com>
Subject Re: Please help - Using IBatis in RAD 7.0
Date Tue, 23 Oct 2007 09:09:36 GMT
Hi Venkat,
        The first error you are getting is definitely because of wrong 
jdbc type. 
I tried the code you have given and it gives the same error (register 
output parameters failed) until I change it to VARCHAR instead of 
VARCHAR2. After doing the change, the code is running through iBATIS 
displaying expected results.  Which database are you using? 
        One more thing, you can remove resultClass from procedure as you 
are already giving parameterClass of the same map.
        As far as the transaction is getting timed out is concerned, are 
you providing some timeout values yourself? because I am not and the 
procedure is executing without problem.
 
Cheers,
Abhigyan Agrawal 




IBATIS <venkatesh.madhavan@wipro.com> 
20/10/2007 16:45
Please respond to
user-java@ibatis.apache.org


To
user-java@ibatis.apache.org
cc

Subject
Re: Please help - Using IBatis in RAD 7.0







Larry,

Sorry for not being clear with my queries. I have refined my query as 
below.
Please help me out.

I have a stored procedure as below.

CREATE OR REPLACE procedure mytest
                 (
                 In_Bag_ID      in     varchar,
                 In_Station     in     varchar,
                 In_Crtn_Dtm    in     varchar,
                 Out_Bag_Data          out varchar2,
                 Out_Return_Cde        out number)
is
Begin
                 Out_Bag_Data := 'success';
                 Out_Return_Cde := 0;
End mytest;
/


My .xml resource file entry is as below

                 <procedure id="retrieveBagTagInfoSP" 
parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
                 {call mytest 
(#bagid,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
#apcde,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
#crtndtm,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
#bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#,
#returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#)}
                 </procedure>

My Calling java programme is as below.

hshBagTag.put("bagid","");
hshBagTag.put("apcde","");
hshBagTag.put("crtndtm","");
hshBagTag.put("bagdata",new String(""));
hshBagTag.put("returncode", new Integer(0));  

SqlMapperClient.queryForObject("retrieveBagTagInfoSP", 
hshBagTag,hshBagTag);

While I invoke the stored procedure, I am getting the following error

--- The error occurred in com/nwa/safetrac/domain/common/dao/sql/Bags.xml. 
 
--- The error occurred while executing query procedure. 
--- Check the {call mytest (?, ?, ?, ?, ?)}. 
--- Check the output parameters (register output parameters failed). 
--- Cause: java.sql.SQLException: Invalid column type


In the same above I changed the 

#bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#, 
to
#bagdata,javaType=java.lang.String,jdbcType=VARCHAR,mode=OUT#, 

and
#returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#
to
#returncode,javaType=java.lang.Double,jdbcType=DECIMAL,mode=OUT#)

Now, the above error was not occurring but the transaction is getting 
timed
out. 

Could you please tell me where I am going wrong,  I am badly in need of a
help.

My Environment is as below.

Development Environment  -  RAD 7.0 (Websphere Application server 6.0)
Ibatis jar files - ibatis-common-2.jar / ibatis-sqlmap-2.jar (i got it 
from
jpetstore example package)

Regards
Venkat


Larry Meadors-2 wrote:
> 
> I know both work, but without seeing any code...it's impossible for us
> to see what your specific issue is.
> 
> Larry
> 
> 
> On 10/19/07, IBATIS <venkatesh.madhavan@wipro.com> wrote:
>>
>> Hi There,
>>
>> I am facing issues while I invoke a sql / stored procedure in RAD 7.0
>> using
>> Ibatis.
>>
>> Do I need add any .jars or others to make it work with RAD.
>>
>> Please look into the issues as below.
>>
>> 1. while I invoke a plain sql I am not getting the result.
>> 2. While I invoke a stored procedure, the transaction is getting timed
>> out.
>>
>> when i invoke the above using ordinary java.sql.connection ( I get this
>> connection object from SqlMapClient.getDataSource().getConnection()) it
>> is
>> working fine for both points 1&2.
>>
>> Your help will be highly appreciated.
>>
>> Regards
>> Venkat
>> --
>> View this message in context:
>> 
http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13292529

>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13308959

Sent from the iBATIS - User - Java mailing list archive at Nabble.com.



Mime
View raw message