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.