Package java.sql

Examples of java.sql.Time


  public void check_if_support_all_normal_types() throws FailToCastObjectException {
    String d = "2009-02-01";
    String t = "12:23:23";
    String dt = d + " " + t;
    Date date = Castors.me().castTo(d, Date.class);
    Time time = Castors.me().castTo(t, Time.class);
    Timestamp ts = Castors.me().castTo(dt, Timestamp.class);
    EntityTypes exp = new EntityTypes();
    exp.name = "XX";
    exp.enum_s = TT.B;
    exp.enum_i = TT.A;
View Full Code Here


public class Datetime2SqlTime extends Castor<Date, Time> {

  @Override
  public Time cast(Date src, Class<?> toType, String... args) throws FailToCastObjectException {
    return new Time(src.getTime());
  }
View Full Code Here

            ResultSet rs = null;
            try {
                // getTime()
                rs = ps.executeQuery();
                rs.next();
                Time t = rs.getTime(1);
                boolean wn = rs.wasNull();
                if (isNull) {
                    assertNull(t);
                    assertTrue(wn);
                } else {
                    assertFalse(wn);
                    assertEquals("17:14:24", t.toString());
                }
                worked = true;

            } catch (SQLException sqle) {
                sqleResult = sqle;
View Full Code Here

            else
                assertEquals(Date.valueOf("2004-02-14"), d);
            return true;
        }
        case Types.TIME: {
            Time t = rs.getTime(1);
            boolean wn = rs.wasNull();
            if (wn)
                assertNull(t);
            else
                assertEquals(Time.valueOf("00:00:00"), t);
View Full Code Here

            if (!wn)
                checkProcedureOutput(param,paramType,val);           
            return true;
        }
        case Types.TIME: {
            Time val = cs.getTime(param);
            boolean wn = cs.wasNull();
            if (!wn)
                checkProcedureOutput(param,paramType,val);
            return true;
        }
View Full Code Here

           
        case Types.TIME:
            long t = r.nextLong();
            if (t < 0)
                t = -t;
             return new Time(t % (24L * 60L * 60L * 1000L));
            
        case Types.TIMESTAMP:
            // limit year to a reasonable value
            long ts = r.nextLong();
            if (ts < 0)
View Full Code Here

        String  columnValue = getString( columnIndex );

        if ( columnValue == null ) { return null; }
        else
        {
            return new Time( parseDateTime( columnValue ) );
        }
    }
View Full Code Here

        initTimePortion(cal, s);

        // Normalize date components as specified by java.sql.Time.
        cal.set(1970, Calendar.JANUARY, 1);

        return new Time(cal.getTimeInMillis());
    }
View Full Code Here

     */
  public Time getTime(int parameterIndex) throws SQLException
  {
    checkStatus();
    try {
      Time v =  getParms().getParameterForGet(parameterIndex-1).getTime(getCal());
      wasNull = (v == null);
      return v;
    } catch (StandardException e)
    {
      throw EmbedResultSet.noStateChangeException(e);
View Full Code Here

     */
    public Time getTime(int parameterIndex, Calendar cal) throws SQLException
  {
    checkStatus();
    try {
            Time v = getParms().
                    getParameterForGet(parameterIndex-1).getTime(cal);
      wasNull = (v == null);
      return v;
    } catch (StandardException e)
    {
View Full Code Here

TOP

Related Classes of java.sql.Time

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.