added numerous nullpointer checks and enclosed parts that can throw an exception in try/catch blocks
Fixed ´Cursor finalized without prior close()´ and SQL connection object leak warnings