ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cornel Antohi" <cant...@kepler-rominfo.com>
Subject Re: DB2 As400 stored procedure with cursor
Date Sat, 17 Jun 2006 13:46:37 GMT
Hi,

What do you mean by "outside of iBATIS"? Directly from JDBC ... yes and I 
should do a rs.beforeFirst() in order to fetch the first row ... otherwise I 
will get the result starting from second row.

Thank you,
Cornel Antohi

----- Original Message ----- 
From: "Sven Boden" <list123@pandora.be>
To: <user-java@ibatis.apache.org>
Sent: Saturday, June 17, 2006 4:22 PM
Subject: Re: DB2 As400 stored procedure with cursor


>
> iBATIS doesn't use "scrollable cursors", it doesn't keep state of the 
> ResultSet in between calls. So beforeFirst() should be irrelevant. If 
> iBATIS opens the ResultSet it will start by reading the first row, then 
> the next one, until the end, close the ResultSet and then queryForList 
> returns. On the other hand I've never done anything with stored procedures 
> on an AS400... so maybe it's a broken/non standard thing for AS400 (which 
> then won't work with iBATIS), in Oracle I never had problems with it.
>
> But did you try to already try to run the query/stored procedure outside 
> of iBATIS?
>
> Regards,
> Sven
>
> Cornel Antohi wrote:
>
>>Hi,
>>
>>Using pure JDBC (JT400) , stored procedures using CURSOR should be used 
>>like that in order to fetch the first row:
>>
>>ctmt = con.prepareCall("{call FPRPR_SEARCHPRODUCTS(?,?)}", 
>>ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
>>....
>>rs.beforeFirst();
>>
>>Can iBATIS do that or should I use JDBC for this task? We are using iBATIS 
>>but such kind of stuff that cannot be done (or I do not know the correct 
>>iBATIS solution) are very painful.
>>
>>Thank you for your prompt answer,
>>Cornel Antohi
>>
>>
>>
>>----- Original Message ----- 
>>From: "Sven Boden" <list123@pandora.be>
>>To: <user-java@ibatis.apache.org>
>>Sent: Saturday, June 17, 2006 3:48 PM
>>Subject: Re: DB2 As400 stored procedure with cursor
>>
>>
>>
>>>There's nothing in iBATIS that would do that. Can you check whether you 
>>>get the same results with your favorite query tool.
>>>
>>>Regards,
>>>Sven
>>>
>>>Cornel Antohi wrote:
>>>
>>>
>>>>Hi,
>>>>
>>>>I am using a stored procedure that opens a cursor and I am trying to 
>>>>obtain the results with queryForList(). Unfortunatelly I receive the 
>>>>results without the first row (first row it is skipped). Any solution to 
>>>>this issue?
>>>>
>>>>Thank you,
>>>>Cornel Antohi
>>>>
>>>>
> 


Mime
View raw message