code: public static void rollbackAndClose(Connection conn) throws SQLException {
          if (conn != null) {
              try {
                  conn.rollback();
              } finally {
                  conn.close();
              }
          }
      }
docs: Performs a rollback on the <code>Connection</code> then closes it,
  avoid closing if null.
  
  @param conn Connection to rollback.  A null value is legal.
  @throws java.sql.SQLException if a database access error occurs
  @since DbUtils 1.1