Here you can find the source of toTime(String str)
public static Time toTime(String str)
//package com.java2s; import java.sql.Time; public class Main { public static Time toTime(String str) { if (str == null) { return null; }//w w w . j a va2s . c o m try { return (str.length() == 5 ? Time.valueOf(str + ":00") : Time.valueOf(str)); } catch (Exception e) { return null; } } }