Results 1 to 7 of 7
  1. #1
    Join Date
    May 2002
    Posts
    2

    Unanswered: CLI0145E Fetch type out of range.

    Hi,
    When i try to call resultset.last() method on scrollable resultset i am getting the following error message :
    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0145E Fetch type out of range. SQLSTATE=HY106

    I am using Visual Age for Java.

    Can any one help me in this problem?

    Thanks
    Radhika

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    What type of cursor are you using ? What other methods can you use on the resultset ?

  3. #3
    Join Date
    May 2002
    Posts
    2
    Originally posted by rnealejr
    What type of cursor are you using ? What other methods can you use on the resultset ?
    I have choosen TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY
    options for the resultset. Basically I want to get the row count in the resultset. So first method i am calling is resultSet.last(), there itself I could not proceed. Later I am using other methods like getRow(), first(), but I could not go till there.
    Do u have any clue why is it giving exception?

    Thanks
    Radhika

  4. #4
    Join Date
    Feb 2002
    Posts
    2,232
    Comment out the last() method and just try executing a next twice and then a previous. Also, please post your code including the connection/statement/resultset. Let me know the results of this test - just try the next and previous methods only and see if an error is returned.

  5. #5
    Join Date
    May 2002
    Posts
    2

    reply expected immediately

    hi,
    i've weblogic5.1 & i am working with stateless session beans. i am able to deploy the bean. but, when i run the client class, it is getting connected to the server and then, the following error occurs:
    Exception java.rmi.RemoteException: java.lang.NoClassDefFoundError: org/xml/sax/InputSource
    at org.jdom.input.SAXBuilder.build...........
    at XMLReaderBean.readXML.............

    my bean class is XMLReaderBean which would read the contents of
    an xml file. hence, i've imported the org.jdom.input.SAXBuilder.

    kindly, let me know how to correct this error. expecting ur immediate reply.



    regards,
    subha

  6. #6
    Join Date
    Sep 2002
    Posts
    1

    Exclamation

    Originally posted by rnealejr
    Comment out the last() method and just try executing a next twice and then a previous. Also, please post your code including the connection/statement/resultset. Let me know the results of this test - just try the next and previous methods only and see if an error is returned.

    Hello. I too am experiencing this CLI0145E with SQLSTATE=HY106 issue. . .I am also using the same params on the resultset:
    ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR _READ_ONLY

    I tried your suggestion to the previous person... commenting out the .last() method and then trying a few .next() and then a .previous(). These statements worked fine... yet in my next line of code I try to get the number of rows: int nbrRows = gVORS.getRow(); and it says that I have 0.

    Did the two of you find a solution back in May?

    Thanks so much for your help!

    sswieca

  7. #7
    Join Date
    Feb 2005
    Posts
    8
    hi.
    I get the same message during CLI Programming.

    ** connection and initilization and something else are already established.**

    // allocate statement handle
    cliRC = SQLAllocHandle(SQL_HANDLE_STMT, m_hdbc, &m_hstmt);
    DBC_HANDLE_CHECK(m_hdbc, cliRC);

    cliRC = SQLSetStmtAttr(m_hstmt, SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER)SEARCH_PAGE_CNT, 0);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLSetStmtAttr(m_hstmt,SQL_ATTR_CURSOR_TYPE,(SQLPO INTER)SQL_CURSOR_STATIC,0);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLSetStmtAttr(m_hstmt,SQL_ATTR_USE_BOOKMARKS,(SQL POINTER)SQL_UB_VARIABLE,0);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLSetStmtAttr(m_hstmt,SQL_ATTR_ROWS_FETCHED_PTR, &rowsFetchedNb,0);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLSetStmtAttr(m_hstmt, SQL_ATTR_ROW_BIND_TYPE, (SQLPOINTER)(sizeof (LogRec) / SEARCH_PAGE_CNT),0);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLExecDirect(m_hstmt, (unsigned char *)(LPCTSTR)m_query, SQL_NTS);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLBindCol(m_hstmt,2 /*the first column is ignored */,SQL_C_TIMESTAMP,(SQLPOINTER)LogRec[0].LogDate,20,&LogRec[0].ind1);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLBindCol(m_hstmt,3,SQL_C_CHAR,(SQLPOINTER)LogRec[0].FWID,13, &LogRec[0].ind2);
    STMT_HANDLE_CHECK(m_hstmt, pPage->m_hdbc, cliRC);

    cliRC = SQLBindCol(m_hstmt,4,SQL_C_CHAR,(SQLPOINTER)LogRec[0].Code,7,&LogRec[0].ind3);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLBindCol(m_hstmt,5,SQL_C_CHAR,(SQLPOINTER)&LogRe c[0].Priority,5,&LogRec[0].ind4);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLBindCol(m_hstmt,6,SQL_C_CHAR,(SQLPOINTER)&LogRe c[0].ThreadID,11,&LogRec[0].ind5);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLBindCol(m_hstmt,7,SQL_C_CHAR,(SQLPOINTER)LogRec[0].Msg,1025,&LogRec[0].ind6);
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC);

    cliRC = SQLFetchScroll(m_hstmt, SQL_FETCH_ABSOLUTE, lPoint); // SQL_ERROR
    STMT_HANDLE_CHECK(m_hstmt, m_hdbc, cliRC); // CLI0145E Fetch type out of range.

    if (cliRC != SQL_NO_DATA_FOUND) {
    for (i = 0; i < rowsFetchedNb; i++) {
    pView->InsertProc(LogRec[i], i);
    }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •