code: public static java.sql.Time toTime(Object value) {
         if (value == null) {
              return null;
          } else if (value instanceof java.sql.Time) {
              return (java.sql.Time) value;
          } else if (value instanceof java.util.Date) {
             return new java.sql.Time(((java.util.Date) value).getTime());
          } else if (value instanceof Number) { // SQLite returns TIME as Integer
             return new java.sql.Time(((Number) value).longValue());
          } else {
             return java.sql.Time.valueOf(value.toString().trim());
          }
      }
docs: If the value is instance of java.sql.Time, returns it, else tries to convert java.util.Date or Long to
  Time, else tries to convert using {@link java.sql.Time#valueOf(String)}.
  This method might trow <code>IllegalArgumentException</code> if fails at conversion.
  
  @see java.sql.Time#valueOf(String)
  @param value value to convert
  @return instance of java.sql.Time