Skip to content

Tag: java

Returning ResultSet without close?

I would like to have a database connection managing class which I can use for simple SQL commands like SELECT, INSERT etc. by simple calling something like this (class below): This is class I’ve found on web: Is this way of returning ResultSet without closing it (and closing the statement) right? How ca…

How to check a Long for null in java

How do I check a Long value for null in Java? Will this work? Answer Primitive data types cannot be null. Only Object data types can be null. There are 8 primitive types in Java: Data Type Size Description byte 1 byte Int8 short 2 bytes Int16 int 4 bytes Int32 long 8 bytes Int64 float 4 bytes Single double