Package java.sql

Examples of java.sql.Time


                              (mod == 7) ? null : new Float(i),
                              (mod == 8) ? null : new Integer(i),
                              (mod == 9) ? null : new Long(i),
                              (mod == 10) ? null : new Short((short)i),
                              (mod == 11) ? null : sampleString(i),
                              (mod == 12) ? null : new Time(currentTime),
                              (mod == 13) ? null : new Timestamp(currentTime)
                            };
            batch[i] = Arrays.asList(data);
        }
        return batch;
View Full Code Here


    int startHrs = 0;
    int startMins = 0;
    int endHrs = 0;
    int endMins = 0;
    Time tStartTime;
    Time tEndTime;
    String returnStatus = "failure";

    String rowId = request.getParameter("rowId");

    HttpSession session = request.getSession(true);
View Full Code Here

   * @throws TransformationException if value is an incorrect input type or
   * the transformation fails
   */
  public Object transformDirect(Object value) throws TransformationException {
    value = ((String) value).trim();
    Time result = null;
    try {
      result = Time.valueOf((String)value);
    } catch(Exception e) {
      throw new TransformationException(e, "ERR.003.029.0025", CorePlugin.Util.getString("ERR.003.029.0025", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
    if (!result.toString().equals(value)) {
      throw new TransformationException(CorePlugin.Util.getString("transform.invalid_string_for_date", value, getTargetType().getSimpleName())); //$NON-NLS-1$
    }
    return result;
  }
View Full Code Here

        Object actual = FunctionMethods.round(number, places);
        assertEquals("round(" + number + "," + places + ") failed.", expected, actual); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }

    public static void helpTestHour1(String timeStr, int expected) {
        Time t = Time.valueOf(timeStr);
        Object actual = FunctionMethods.hour(t);
        assertEquals("hour(" + t + ") failed", new Integer(expected), actual); //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

    }

    // case 2458
    @Test public void testCurrentTime() throws Exception {
       
        Time curDate = (Time)FunctionMethods.currentTime();

        Calendar cal1 = Calendar.getInstance();
        cal1.setTime(curDate);
       
        // can not test the current time without making a copy of current "time"
View Full Code Here

    private Object consumeMsg(Time object, Element cellElement) throws JDOMException {

        // -----------------------
        // Process the element ...
        // -----------------------
        Time result;
        try {
            result = Time.valueOf(cellElement.getTextTrim());
        } catch ( Exception e ) {
            throw new JDOMException("Invalid input format ", e); //$NON-NLS-1$
        }
View Full Code Here

   * @return The value of the column as a Time object.
   * @throws SQLException
   *     if a results access error occurs or transform fails.
   */
  public Time getTime(int columnIndex, Calendar cal) throws SQLException {
    Time value = DataTypeTransformer.getTime(getObject(columnIndex));

    if (value != null && cal != null) {
      value = TimestampWithTimezone.createTime(value,
          getDefaultCalendar().getTimeZone(), cal);
    }
View Full Code Here

    assertEquals(calendar, result);
  }

  @Test
  public void testTimeConversion() {
    Time time = new Time(1L);
    Time result = (Time) converter.convert(Time.class, time);
    assertEquals(result, time);
  }
View Full Code Here

        IntMember referencetype = new IntMember( "Reference" ,0 , 10 , "", 'T' , true , 10 );

        IntMember intmem = new IntMember( "ID" , timeSlipID , 10 , "URL", 'T' , true , 10 );
        //IntMember projectId = new IntMember( "ProjectID" , projectID , 10 , "URL", 'T' , true , 10 );

        Time tStartTime = (Time)hm.get("Start");
        Time tEndTime = (Time)hm.get("End");

        Calendar calendarStart = Calendar.getInstance();
        calendarStart.setTime(tStartTime);

        Calendar calendarEnd = Calendar.getInstance();
View Full Code Here

     * @param x the time
     * @param calendar the calendar
     * @return the time using the correct time zone
     */
    public static Time convertTimeToCalendar(Time x, Calendar calendar) {
        return x == null ? null : new Time(convertToLocal(x, calendar));
    }
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.