Added check to determine if the DB connection has been closed. If yes, then get a new connection.
Sort keys by age when printing them. Also fix a generics warning.
VarInt patch by "bake3978", taken from https://code.google.com/p/bitcoinj/issues/detail?id=582

Deleted unnecessary codes; long val; ... val = first; ... this.value = val; -> this.value = first;
Replace two occurences of pom versions with ${project.version}. It makes incrementing the version a little bit less painful.