Fix Exception Handling

Previous update will throw an error of NoResultException but I catch
NullPointerException. I fix this error and config JDBC Realm on the
server.