db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vatter <thomas.vat...@network-inventory.de>
Subject ResultSet.getInt()
Date Wed, 22 Feb 2006 19:49:59 GMT

I have a problem using ResultSet.getInt() method, each call returns an 
exception:
org.apache.derby.client.am.SqlException: Invalid operation:
wasNull() called with no data retrieved
        at org.apache.derby.client.am.ResultSet.wasNull(Unknown Source)

The code is
        ResultSetMetaData RSMD = RS.getMetaData();
        int INTcols = RSMD.getColumnCount();
        String STRtemp = null;
        while(RS.next())
        {
            String STRvalue = new String();           
            for(int INTcol = 1; INTcol <= INTcols; INTcol++)
            {
                int INTdummy = RSMD.getColumnType(INTcol);              
                switch((int)RSMD.getColumnType(INTcol))
                {
                        if(!RS.wasNull()) // raises exception
                        
{                                                                                        
           

                            STRvalue = "" + 
RSaktuelles.getInt(INTcol);                                              
                        } 
        ...
        }
         }
    }

what can I do to avoid this exception

tom


Mime
View raw message