DB2 SQL error: SQLCODE: -805, SQLSTATE: 51002
Sounds like you are not properly deallocating objects like Statement, ResultSet, etc., so your application is holding open statement handles in the database.  This will eventually exhaust "CLI Packages" in the database, resulting in the SQL0805N error.

The proper solution is to make sure that you close these as soon as you're done reading them.

You may also find documents suggesting that you rebind to increase the number of CLI packages at the database level, but keep in mind that this is just a band-aid.