Results 1 to 3 of 3

Thread: No Columns in MappingSqlQuery.mapRow

  1. #1
    Join Date
    Nov 2007
    Posts
    2

    Default No Columns in MappingSqlQuery.mapRow

    Hello,

    i'm stuck on a problem with MappingSqlQuery. My overridden mapRow(ResultSet rs, int rowIndex) method is called, but the resultset seems to be holding no values.
    mysql server log reports a correct query which returns one row, but if i execute rs.getInt(0), an exception occurs
    Code:
    java.sql.SQLException: Column Index out of range, 0 < 1.
    any ideas?

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    Check the javadocs and also read the error message that gives it away also.

    getInt

    public int getInt(int columnIndex)
    throws SQLException

    Retrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language.

    Parameters:
    columnIndex - the first column is 1, the second is 2, ...
    Returns:
    the column value; if the value is SQL NULL, the value returned is 0
    Throws:
    SQLException - if a database access error occurs
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Nov 2007
    Posts
    2

    Red face

    ahh...

    i really did read the docs, but i simply read over it, it seems...

    thank you so much...

Posting Permissions

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