code: private String escape(final String val) {
  		// TODO: this function is ugly, pass this work off to SQLite, then we
  		//       don't have to worry about Unicode 4, other characters needing
  		//       escaping, etc.
  		int len = val.length();
  		StringBuilder buf = new StringBuilder(len);
  		for (int i = 0; i < len; i++) {
  			if (val.charAt(i) == '\'') {
  				buf.append('\'');
  			}
  			buf.append(val.charAt(i));
  		}
  		return buf.toString();
  	}
docs: Applies SQL escapes for special characters in a given string.
  @param val The string to escape.
  @return The SQL escaped string.