Tidy JDBC code and use chomp() instead of trim.