wood burning stoves 2.0*
The moose likes JDBC and the fly likes JayBird / Firebird nullpointerexception when using getInt() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JayBird / Firebird nullpointerexception when using getInt()" Watch "JayBird / Firebird nullpointerexception when using getInt()" New topic
Author

JayBird / Firebird nullpointerexception when using getInt()

Greg Reeder
Ranch Hand

Joined: Jun 14, 2011
Posts: 99

hi,

Does anyone have any experiance with Jaybird? I am trying to use the resultSet.getInt("columnName") method to set an int object. Code :



the column name is correct, I checked it, rechecked it and rechecked it yet again. If I take out the int tax line, I have the same issues the next time I use the getInt() for amount and income. Any hints as to what Im doing wrong?

Greg
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19653
    
  18

You should definitely not get a NullPointerException when calling getInt. If the database value is null getInt should return 0 (required by the ResultSet API), and if the column doesn't exist it should throw an SQLException, not a NullPointerException. Which driver are you using? Is it the latest version?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Greg Reeder
Ranch Hand

Joined: Jun 14, 2011
Posts: 99

It is the latest download, 2.1.6. I am at a bit of a loss as to what I should do. .getFetchSize returns 0 although FlameRobin shows that the size should come out as 2. I use the same code, and it works in the FlameRobin front end (where I test all of my statements before wiring them into my DBController class. I've even gone so far as to copy and past it, Ive shut down the server and restarted it to garantee that there was no back ground error. I dont know what Im screwing up.
Greg Reeder
Ranch Hand

Joined: Jun 14, 2011
Posts: 99

Problem solved. Stupid errors only. It was fixed when joined two tables together and accessed the database once rather than trying to access it a second time while already reading from it. The nullpointer exception was caused by my own stupidity. It is now fixed.
Greg Reeder
Ranch Hand

Joined: Jun 14, 2011
Posts: 99

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JayBird / Firebird nullpointerexception when using getInt()
 
Similar Threads
procedures and functions
Connection to Oracle Database
Clumsy code
Please help : toByteArray(myBlob) fails ???
Displaying an Oracle BLOB image.