Your first mistake is making this a scriptlet in a jsp. At the very least use either a Servlet or the sql JSTL tags, better would be to use some application beans. The actual error, however, means that you have an empty field in that row that you are retreiving as a String (and so results in null) and you are parsing that String to a number. Since the reference value null is not a valid String object (and even if it were the value would not be a valid number value) you cannot parse it to a number. Why do you not use getInt, rather than getString. And query the table explicitly (i.e. select col1, col2, ... rather than select *) and use a null check (in oracle it would be something like nvl(col, defaultValue), in Access I don't know and don't feel like checking).