Handling database key managment in an application is a bad way of doing it (update anomlies, failed inserts and so on, if more than one connection can commit to the table at any given time). The piece of code here relies on the fact that there will only ever be one application and one CitadelReinforcementData object at any given point in time.
https://github.com/Civcraft/Citadel/blob/master/src/vg/civcraft/mc/citadel/database/CitadelReinforcementData.java#L548
Handling database key managment in an application is a bad way of doing it (update anomlies, failed inserts and so on, if more than one connection can commit to the table at any given time). The piece of code here relies on the fact that there will only ever be one application and one CitadelReinforcementData object at any given point in time.
Using https://docs.oracle.com/javase/7/docs/api/java/sql/Connection.html#prepareStatement%28java.lang.String,%20int%29 in conjunction with https://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#RETURN_GENERATED_KEYS is a much safer way to handle key generation and managment.