setmaxrows not working with CallableStatement - Weblogic

This is a discussion on setmaxrows not working with CallableStatement - Weblogic ; hi, we are using weblogic 8.1 and oracle9i jdbc, and I try to setmaxrows to N for a stored procedure. it doesnt work, resultset get more than N rows. Anybody have idea what's going on. here is the code: Object ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: setmaxrows not working with CallableStatement

  1. setmaxrows not working with CallableStatement


    hi,
    we are using weblogic 8.1 and oracle9i jdbc, and I try to setmaxrows to N for
    a stored procedure. it doesnt work, resultset get more than N rows.
    Anybody have idea what's going on. here is the code:

    Object obj = initContext.lookup(config.getDataSource(this.key). getJNDIPath()
    + this.key);

    DataSource ds = (DataSource) obj;
    connection = ds.getConnection();

    String sp = "{ call " + serviceName + "(" + params + ")}";

    CallableStatement procout = (CallableStatement) connection.prepareCall
    (sp);
    ......
    procout.setMaxRows(N);

    results = procout.execute();

    ResultSet rs = (ResultSet)procout.getObject(nParams);

    while(rs.next()) {
    nrows++;
    }

    finally nrows is bigger than N.

    thanks.
    Yev.

  2. Re: setmaxrows not working with CallableStatement

    Hi.
    It is very likely that your DBMS and/or JDBC driver doesn't/can't implement
    setMaxRows. What JDBC driver is it? You can test it by altering your code to
    get a connection directly from the JDBC driver.
    Joe

    yev wrote:

    > hi,
    > we are using weblogic 8.1 and oracle9i jdbc, and I try to setmaxrows to N for
    > a stored procedure. it doesnt work, resultset get more than N rows.
    > Anybody have idea what's going on. here is the code:
    >
    > Object obj = initContext.lookup(config.getDataSource(this.key). getJNDIPath()
    > + this.key);
    >
    > DataSource ds = (DataSource) obj;
    > connection = ds.getConnection();
    >
    > String sp = "{ call " + serviceName + "(" + params + ")}";
    >
    > CallableStatement procout = (CallableStatement) connection.prepareCall
    > (sp);
    > ......
    > procout.setMaxRows(N);
    >
    > results = procout.execute();
    >
    > ResultSet rs = (ResultSet)procout.getObject(nParams);
    >
    > while(rs.next()) {
    > nrows++;
    > }
    >
    > finally nrows is bigger than N.
    >
    > thanks.
    > Yev.



  3. Re: setmaxrows not working with CallableStatement


    I try getting connection directly from the JDBC driver but nothing happen.
    setmaxrows to CallableStatement dont work, but worked to Statement.
    I use JDBC driver Oracle 9.2.0.3.

    thanks,
    Yev.

    Joe Weinstein wrote:
    >Hi.
    >It is very likely that your DBMS and/or JDBC driver doesn't/can't implement
    >setMaxRows. What JDBC driver is it? You can test it by altering your
    >code to
    >get a connection directly from the JDBC driver.
    >Joe
    >
    >yev wrote:
    >
    >> hi,
    >> we are using weblogic 8.1 and oracle9i jdbc, and I try to setmaxrows

    >to N for
    >> a stored procedure. it doesnt work, resultset get more than N rows.
    >> Anybody have idea what's going on. here is the code:
    >>
    >> Object obj = initContext.lookup(config.getDataSource(this.key). getJNDIPath()
    >> + this.key);
    >>
    >> DataSource ds = (DataSource) obj;
    >> connection = ds.getConnection();
    >>
    >> String sp = "{ call " + serviceName + "(" + params + ")}";
    >>
    >> CallableStatement procout = (CallableStatement) connection.prepareCall
    >> (sp);
    >> ......
    >> procout.setMaxRows(N);
    >>
    >> results = procout.execute();
    >>
    >> ResultSet rs = (ResultSet)procout.getObject(nParams);
    >>
    >> while(rs.next()) {
    >> nrows++;
    >> }
    >>
    >> finally nrows is bigger than N.
    >>
    >> thanks.
    >> Yev.

    >



  4. Re: setmaxrows not working with CallableStatement



    Yev wrote:

    > I try getting connection directly from the JDBC driver but nothing happen.


    What do you mean 'nothing happened'? If you mean 'nothing changed', then
    you have proven that it is an oracle driver problem.

    > setmaxrows to CallableStatement dont work, but worked to Statement.
    > I use JDBC driver Oracle 9.2.0.3.


    Understood. I can promise you that weblogic does nothing with your
    setMaxRows() call, except pass it unaltered to the DBMS driver you're
    using. I suggest you open a TAR with oracle to find out whether they
    have fixed or will fix or can fixt the driver to do what you want.
    Joe

    >
    > thanks,
    > Yev.
    >
    > Joe Weinstein wrote:
    >
    >>Hi.
    >>It is very likely that your DBMS and/or JDBC driver doesn't/can't implement
    >>setMaxRows. What JDBC driver is it? You can test it by altering your
    >>code to
    >>get a connection directly from the JDBC driver.
    >>Joe
    >>
    >>yev wrote:
    >>
    >>
    >>>hi,
    >>>we are using weblogic 8.1 and oracle9i jdbc, and I try to setmaxrows

    >>
    >>to N for
    >>
    >>>a stored procedure. it doesnt work, resultset get more than N rows.
    >>>Anybody have idea what's going on. here is the code:
    >>>
    >>> Object obj = initContext.lookup(config.getDataSource(this.key). getJNDIPath()
    >>>+ this.key);
    >>>
    >>> DataSource ds = (DataSource) obj;
    >>> connection = ds.getConnection();
    >>>
    >>> String sp = "{ call " + serviceName + "(" + params + ")}";
    >>>
    >>> CallableStatement procout = (CallableStatement) connection.prepareCall
    >>>(sp);
    >>> ......
    >>> procout.setMaxRows(N);
    >>>
    >>> results = procout.execute();
    >>>
    >>> ResultSet rs = (ResultSet)procout.getObject(nParams);
    >>>
    >>> while(rs.next()) {
    >>> nrows++;
    >>> }
    >>>
    >>>finally nrows is bigger than N.
    >>>
    >>>thanks.
    >>>Yev.

    >>

    >



+ Reply to Thread