Package java.sql

Examples of java.sql.Time


     * type of object to be stored in the table cell.
     */
   public Object readResultSet(ResultSet rs, int index, boolean limitDataRead)
      throws java.sql.SQLException {

      Time data = rs.getTime(index);
      if (rs.wasNull())
         return null;
      else return data;
   }
View Full Code Here


      // no default in DB.  If nullable, use null.
      if (_isNullable)
         return null;

      // field is not nullable, so create a reasonable default value
      return new Time(new java.util.Date().getTime());
   }
View Full Code Here

            millis = HsqlDateTime.convertMillisToCalendar(calendar, millis);
            millis = HsqlDateTime.getNormalisedTime(millis);
        }

        return new Time(millis);
    }
View Full Code Here

            millis = HsqlDateTime.convertMillisToCalendar(calendar, millis);
            millis = HsqlDateTime.getNormalisedTime(millis);
        }

        return new Time(millis);
    }
View Full Code Here

        {
            return new java.sql.Date(getDatabaseAdapter().getAdapterTime(value));
        }
        else if (getJavaTypeMapping().getJavaType().getName().equals(ClassNameConstants.JAVA_SQL_TIME))
        {
            return new Time(getDatabaseAdapter().getAdapterTime(value));
        }
        else
        {
            return new Timestamp(getDatabaseAdapter().getAdapterTime(value));
        }
View Full Code Here

            {
                ((PreparedStatement) ps).setNull(param, getTypeInfo().getDataType());
            }
            else if (value instanceof Calendar)
            {
                ((PreparedStatement) ps).setTime(param, new Time(((Calendar)value).getTime().getTime()));
            }
            else
            {
                ((PreparedStatement) ps).setTime(param, (Time)value);
            }
View Full Code Here

        }
    }

    protected Time getTime(Object rs, int param)
    {
        Time value;

        try
        {
            value = ((ResultSet) rs).getTime(param);
        }
View Full Code Here

     * @param param The parameter position
     * @return The object value
     **/
    public Object getObject(Object rs, int param)
    {
        Time value = getTime(rs, param);

        if (value == null)
        {
            return null;
        }
View Full Code Here

    }

    public void testTimeComplex() {
        PreparedStatement ps = null;
        ResultSet rs = null;
        Time aTime = Time.valueOf("21:19:27");

        try {
            ps = netConn.prepareStatement(
                "INSERT INTO alltypes(id, t) VALUES(?, ?)");
            ps.setInt(1, 3);
View Full Code Here

      assertEquals(tm.getTime() / 1000, et.sqlDT.getTime() / 1000);
  }

  @Test
  public void check_for_sqlTime() {
    Time time = Castors.me().castTo("07:09:12", Time.class);
    dao.insert(EntityTypes.class, Chain.make("name", "ABC").add("sqlTime", time));
    EntityTypes et = dao.fetch(EntityTypes.class);
    assertEquals(time.toString(), et.sqlTime.toString());
  }
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.