ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tushar Kherde" <kherde.tus...@gmail.com>
Subject Re: fetchSize
Date Tue, 13 Feb 2007 15:46:43 GMT
I have mentioned the fetchSize in select  element

Following is the code


<select  fetchSize="5" id="ICE_COUNTRY.abatorgenerated_selectForIndex"
resultMap="abatorgenerated_IceCountryResult" parameterClass="java.util.Map"
>
    <!--
      WARNING - This element is automatically generated by Abator for
ICEFRAMEWORK, do not modify.
      This element was generated on Fri Dec 01 17:37:59 IST 2006.
    -->
    select COUNTRY_CODE, COUNTRY_NAME, COUNTRY_SHORT_NAME, RECORD_STATUS,
RECORD_ADDBY,
      RECORD_ADDDATE, RECORD_EDITBY, RECORD_EDITDATE, RECORD_APPROVEBY,
RECORD_APPROVEDATE,
      RECORD_DELETEBY, RECORD_DELETEDATE
    from ICE_COUNTRY
    <isParameterPresent >
      <include refid="ICE_COUNTRY.abatorgenerated_Example_Where_Clause" />
      <isPropertyAvailable property="ABATOR_ORDER_BY_CLAUSE" >
        order by $ABATOR_ORDER_BY_CLAUSE$
      </isPropertyAvailable>
    </isParameterPresent>
  </select>

which is calling from DAOImpl  using queryforlist  which list i am
displaying on index page. But it fetching all records.


On 2/13/07, Clinton Begin <clinton.begin@gmail.com> wrote:
>
> Regardless, all of the other points still apply.  :-)
>
> How are you testing to see if it works?
>
> Clinton
>
> On 2/13/07, Tushar Kherde <kherde.tushar@gmail.com> wrote:
> > Sorry i am using ojdbc14.jar not jdbc14.jar which is for 10g i think its
> > recent release.
> >
> >
> > On 2/13/07, Clinton Begin <clinton.begin@gmail.com> wrote:
> > > You're using an 8 year old database and a 5 year old driver.  :-)
> > >
> > > The combination may not support fetch size properly.
> > >
> > > Furthermore, even if it is supported by the driver, it is not
> > > guaranteed to fetch exactly that number of rows.  The following is an
> > > excerpt from the JDK JavaDoc for PreparedStatement.setFetchSize()
> > >
> > > ---------------
> > > Gives the JDBC driver a hint as to the number of rows that should be
> > > fetched from the database when more rows are needed. The number of
> > > rows specified affects only result sets created using this statement.
> > > If the value specified is zero, then the hint is ignored. The default
> > > value is zero.
> > > ---------------
> > >
> > > Clinton
> > >
> > > On 2/13/07, Tushar Kherde < kherde.tushar@gmail.com> wrote:
> > > > I tried it with oracle 8i and driver jdbc14.jar but not working :(
> > > > I just added the fetchSize="5" attribute in select element. Is there
> > > > anything else i need to do please correct if i am wrong.
> > > > I am using iBATIS2.0 ( Note: i was using iBATIS1.0 and upgraded just
> by
> > > > changing jars )
> > > > If possible I need generic solution for this because my system is
> > dealing
> > > > with different databases.
> > > > Thanks in advance.
> > > >
> > > >  On 2/13/07, Brandon Goodin <brandon.goodin@gmail.com> wrote:
> > > > > Sorry for the bad info. Learn something new all the time. :-/
> > > > >
> > > > > Brandon
> > > > >
> > > > >
> > > > >
> > > > > On 2/13/07, Clinton Begin <clinton.begin@gmail.com > wrote:
> > > > > > Actually it does!
> > > > > >
> > > > > > <select ... fetchSize="50">
> > > > > >
> > > > > > Remember that it's just a hint though...not a guarantee IIRC.
> > > > > >
> > > > > > Clinton
> > > > > >
> > > > > > On 2/13/07, Brandon Goodin < brandon.goodin@gmail.com>
wrote:
> > > > > > > iBATIS does not provide a means to use the setFetchSize
on a
> > > > > > > PreparedStatement. If you are looking to limit the number
of
> rows
> > you
> > > > get
> > > > > > > back from the database then I suggest using queryForList(id,
> > > > parmObject,
> > > > > > > skip, max) or placing it in your SQL statement like "select
*
> from
> > foo
> > > > where
> > > > > > > rownum<10" in Oracle.
> > > > > > >
> > > > > > > Brandon
> > > > > > >
> > > > > > >
> > > > > > > On 2/13/07, Tushar Kherde < kherde.tushar@gmail.com>
wrote:
> > > > > > > > Hi All,
> > > > > > > >
> > > > > > > > I want to use fetchsize in my select query.
> > > > > > > > Can I get sample for this.
> > > > > > > >
> > > > > > > > --
> > > > > > > > With regards
> > > > > > > > Tushar Kherde
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > With regards
> > > > Tushar Kherde
> > >
> >
> >
> >
> > --
> > With regards
> > Tushar Kherde
>



-- 
With regards
Tushar Kherde

Mime
View raw message