hours = Integer.parseInt(timeAsText); } else { hours      = Integer.parseInt(timeAsText.substring(0, slashPos)); timeAsText = timeAsText.substring(slashPos + 1); slashPos   = timeAsText.indexOf(':');
    public Object convertFromString(String textRep, int sqlTypeCode) throws Exception    {        if (sqlTypeCode != Types.TIME)        {            return textRep;        }        else if (textRep != null)         {            // we're not using {@link java.sql.Time#valueOf(String)} as this method is too strict            // it only parses the full spec "hh:mm:ss"            String timeAsText = textRep;            int    hours      = 0;            int    minutes    = 0;            int    seconds    = 0;            int    slashPos   = timeAsText.indexOf(':');            if (slashPos < 0)            {                hours = Integer.parseInt(timeAsText);            }            else            {                hours      = Integer.parseInt(timeAsText.substring(0, slashPos));                timeAsText = timeAsText.substring(slashPos + 1);                slashPos   = timeAsText.indexOf(':');                if (slashPos < 0)                {                    minutes = Integer.parseInt(timeAsText);                }                else                {                    minutes = Integer.parseInt(timeAsText.substring(0, slashPos));                    seconds = Integer.parseInt(timeAsText.substring(slashPos + 1));                }            }            return new Time(hours, minutes, seconds);                    }        else        {            return null;        }    }