You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Cornel Antohi <ca...@kepler-rominfo.com> on 2006/06/17 14:42:53 UTC

DB2 As400 stored procedure with cursor

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

Re: DB2 As400 stored procedure with cursor

Posted by Sven Boden <li...@pandora.be>.
I had a hunch ;-)
Sven

Cornel Antohi wrote:

> Hi Sven,
>
> Unfortunatelly it was a mistake into the Stored Procedure ... it makes:
> OPEN cursor
> FETCH RELATIVE 1 ....
>
> Sorry, false alarm.
>
> Thank you,
> Cornel



unscribe

Posted by Makunda Thapa <ma...@hotmail.com>.
subject: unscribe

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


Re: DB2 As400 stored procedure with cursor

Posted by Cornel Antohi <ca...@kepler-rominfo.com>.
Hi Sven,

Unfortunatelly it was a mistake into the Stored Procedure ... it makes:
OPEN cursor
FETCH RELATIVE 1 ....

Sorry, false alarm.

Thank you,
Cornel


----- Original Message ----- 
From: "Cornel Antohi" <ca...@kepler-rominfo.com>
To: <us...@ibatis.apache.org>; <li...@pandora.be>
Sent: Saturday, June 17, 2006 5:11 PM
Subject: Re: DB2 As400 stored procedure with cursor


> Hi Sven,
>
> For me, using of beforeFirst() is strange too ...
> I am using iSeries Navigator and this AS400 client returns correctly the 
> first row!
>
> Thank you,
> Cornel
>
> ----- Original Message ----- 
> From: "Sven Boden" <li...@pandora.be>
> To: <us...@ibatis.apache.org>
> Sent: Saturday, June 17, 2006 4:57 PM
> Subject: Re: DB2 As400 stored procedure with cursor
>
>
>>
>> What I'm trying to tell you is that normally you should not use 
>> beforeFirst(), I have never used it in the last 5 years (some JDBC 
>> drivers don't even support it). It should only be used if you want to 
>> scroll back and forth through a ResultSet (where beforeFirst will set you 
>> at the beginning of the ResultSet)....
>> Wouldn't it be logically that if you open a ResultSet it starts at the 
>> first row and not an arbitrary (second) row. This is what all JDBC 
>> drivers I used do... if the AS400 driver doesn't do it, I would consider 
>> it a broken driver. And it would cause problems with iBATIS.
>>
>> With "outside iBATIS" I meant from a query tool... Don't know what 
>> supports AS400... DbVisualizer, WinSql, AQT, ... something that can 
>> extract data from a database. My first hunch would be that your stored 
>> procedure is wrong and you will get the same missing row in such a tool.
>>
>> Regards,
>> Sven
>>
>> Cornel Antohi wrote:
>>
>>> 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" <li...@pandora.be>
>>> To: <us...@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" <li...@pandora.be>
>>>>> To: <us...@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
>>>>>>>
>>>>>>>
>>>>
>>>
>>>
>>>
>>
> 


Re: DB2 As400 stored procedure with cursor

Posted by Cornel Antohi <ca...@kepler-rominfo.com>.
Hi Sven,

For me, using of beforeFirst() is strange too ...
I am using iSeries Navigator and this AS400 client returns correctly the 
first row!

Thank you,
Cornel

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


>
> What I'm trying to tell you is that normally you should not use 
> beforeFirst(), I have never used it in the last 5 years (some JDBC drivers 
> don't even support it). It should only be used if you want to scroll back 
> and forth through a ResultSet (where beforeFirst will set you at the 
> beginning of the ResultSet)....
> Wouldn't it be logically that if you open a ResultSet it starts at the 
> first row and not an arbitrary (second) row. This is what all JDBC drivers 
> I used do... if the AS400 driver doesn't do it, I would consider it a 
> broken driver. And it would cause problems with iBATIS.
>
> With "outside iBATIS" I meant from a query tool... Don't know what 
> supports AS400... DbVisualizer, WinSql, AQT, ... something that can 
> extract data from a database. My first hunch would be that your stored 
> procedure is wrong and you will get the same missing row in such a tool.
>
> Regards,
> Sven
>
> Cornel Antohi wrote:
>
>> 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" <li...@pandora.be>
>> To: <us...@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" <li...@pandora.be>
>>>> To: <us...@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
>>>>>>
>>>>>>
>>>
>>
>>
>>
> 


Re: DB2 As400 stored procedure with cursor

Posted by puneet arya <pu...@yahoo.co.in>.
hi,
    also u have to UPDATE your IBATIS for using stored procedure. you just download IBATIS 1.7 from the net as u know it is a free source . that will also help to run ur stored procedure
                                          Puneet Arya

Sven Boden <li...@pandora.be> wrote:
  
What I'm trying to tell you is that normally you should not use 
beforeFirst(), I have never used it in the last 5 years (some JDBC 
drivers don't even support it). It should only be used if you want to 
scroll back and forth through a ResultSet (where beforeFirst will set 
you at the beginning of the ResultSet)....
Wouldn't it be logically that if you open a ResultSet it starts at the 
first row and not an arbitrary (second) row. This is what all JDBC 
drivers I used do... if the AS400 driver doesn't do it, I would consider 
it a broken driver. And it would cause problems with iBATIS.

With "outside iBATIS" I meant from a query tool... Don't know what 
supports AS400... DbVisualizer, WinSql, AQT, ... something that can 
extract data from a database. My first hunch would be that your stored 
procedure is wrong and you will get the same missing row in such a tool.

Regards,
Sven

Cornel Antohi wrote:

> 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" 

> To: 
> 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" 

>>> To: 
>>> 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
>>>>>
>>>>>
>>
>
>
>



 				
---------------------------------
  Yahoo! India Answers: Share what you know. Learn something new Click here
 Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now

Re: DB2 As400 stored procedure with cursor

Posted by Sven Boden <li...@pandora.be>.
What I'm trying to tell you is that normally you should not use 
beforeFirst(), I have never used it in the last 5 years (some JDBC 
drivers don't even support it). It should only be used if you want to 
scroll back and forth through a ResultSet (where beforeFirst will set 
you at the beginning of the ResultSet)....
Wouldn't it be logically that if you open a ResultSet it starts at the 
first row and not an arbitrary (second) row. This is what all JDBC 
drivers I used do... if the AS400 driver doesn't do it, I would consider 
it a broken driver. And it would cause problems with iBATIS.

With "outside iBATIS" I meant from a query tool... Don't know what 
supports AS400... DbVisualizer, WinSql, AQT, ... something that can 
extract data from a database. My first hunch would be that your stored 
procedure is wrong and you will get the same missing row in such a tool.

Regards,
Sven

Cornel Antohi wrote:

> 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" <li...@pandora.be>
> To: <us...@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" <li...@pandora.be>
>>> To: <us...@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
>>>>>
>>>>>
>>
>
>
>


Re: DB2 As400 stored procedure with cursor

Posted by Cornel Antohi <ca...@kepler-rominfo.com>.
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" <li...@pandora.be>
To: <us...@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" <li...@pandora.be>
>>To: <us...@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
>>>>
>>>>
> 


Re: DB2 As400 stored procedure with cursor

Posted by Sven Boden <li...@pandora.be>.
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" <li...@pandora.be>
>To: <us...@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
>>> 
>>>
>>>      
>>>


Re: DB2 As400 stored procedure with cursor

Posted by puneet arya <pu...@yahoo.co.in>.
hi,
      you can use ibatis for this task. 

Cornel Antohi <ca...@kepler-rominfo.com> 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" <li...@pandora.be>
  To: <us...@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
>>  
>>
> 

 				
---------------------------------
  Yahoo! India Answers: Share what you know. Learn something new Click here
 Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now

Re: DB2 As400 stored procedure with cursor

Posted by Cornel Antohi <ca...@kepler-rominfo.com>.
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" <li...@pandora.be>
To: <us...@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
>>  
>>
>

Re: DB2 As400 stored procedure with cursor

Posted by Sven Boden <li...@pandora.be>.
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
>  
>


Re: DB2 As400 stored procedure with cursor

Posted by puneet arya <pu...@yahoo.co.in>.
hi,
    try queryforObject() instead of queryforList(), may be this is the probs or second there will be problem in ur looping where u r fetching ur results.
                                                                     Puneet Arya


          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


 				
---------------------------------
  Yahoo! India Answers: Share what you know. Learn something new Click here
 Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now