This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
A PK is a database constraint. You cannot insert null into it. So the check is implicit to its purpose, and performed by teh DB. If you are worried about trying to run JDBC code which might be inserting nulls into PK fields, just check for nulls as you would normally before trying to run the code.