It completely depends on the format of yours String, so I would use SimpleDateFormatto parse the string in java.util.Date; then you can extract the millisecond time value from this date and pass it to java.sql.Time(). Like this:
String s = ;
SimpleDateFormat sdf = new SimpleDateFormat();
long ms = sdf.parse(s).getTime();
Time t = new Time(ms);
source
share