db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jørgen Løland <Jorgen.Lol...@Sun.COM>
Subject Re: Re-using an existing db and archiving data
Date Wed, 19 Mar 2008 10:13:14 GMT
Mark Hiles wrote:
> Based on what I've read, I'm not going to get the number of results and store in
> an array, I'll just use 2 ArrayLists instead..
> 
> I'm still getting my null pointer exception for some reason. It must be
> happening inside the rs.next() method when I call it..
> 
> My code looks something like this:
> 
> rs = stmt.executeQuery("...");
>             
> while(rs.next()) {
>     arrLstS.add(rs.getString("..."));
>     arrLstS.add(getRoomName(rs.getInt("...")));
>     arrLstB.add(rows);            
> }
> 
> I caught the exception and did a stack trace but all it said was:
> 
> java.lang.NullPointerException
>         at dbcon.DBCon.getReadings(DBCon.java:308)
>         at dbcon.DBCon.<init>(LocalDBConnection.java:58)
>         at dbcon.DBCon.LocalDBConnection.main(LocalDBConnection.java:39)
> 
> I've put in some test data and the SQL query should return 2 results. But even
> if it didn't return any results, my code just wouldn't go into the while loop. I
> don't see why I'm getting a null pointer exception.
> 
> 
> 
> 

And what happens on line 308 in your DBCon.java file?


-- 
Jørgen Løland

Mime
View raw message