Demos and Usage of java.sql.Timestamp.valueOf(String s)


   1: 
   2: import java.sql.Timestamp;
   3: 
   4:         ...
   5:     public boolean canConvert(Class type) {
   6:         return type.equals(Timestamp.class);
   7:     }
   8:         ...
   9:     public Object fromString(String str) {
  10:         return Timestamp.valueOf(str);
  11:     }

View Full Code Here
   1: import java.sql.Time;
   2: import java.sql.Timestamp;
   3: import java.util.Hashtable;
   4:         ...
   5:             if( val==null || val.length()==0 ) return new Byte((byte)0);
   6:             return Byte.valueOf(val);
   7:         } else
   8:         ...
   9:             if( val==null || val.length()==0 ) return new Double(0);
  10:             return Double.valueOf(val);
  11:         } else
  12:         ...
  13:             if( val==null || val.length()==0 ) return new Float(0);
  14:             return Float.valueOf(val);

View Full Code Here
   1:       try {
   2:         return java.sql.Date.valueOf(tmp);
   3:       } catch (Exception e2) {
   4:         ...
   5: 
   6:   public static java.sql.Timestamp parseTimestampString(String tmp) {
   7:         ...
   8:     java.sql.Timestamp timestampValue = null;
   9:     try {
  10:         ...
  11:       java.util.Date tmpDate = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.LONG).parse(tmp);
  12:       timestampValue = new java.sql.Timestamp(new java.util.Date().getTime());

View Full Code Here
   1: 
   2: import java.sql.Timestamp;
   3: import java.sql.Date;
   4:         ...
   5: 
   6:         return Date.valueOf(getString().trim());
   7:     }
   8:         ...
   9: 
  10:         return Time.valueOf(getString().trim());
  11:     }
  12:         ...
  13:     public Timestamp getTimestamp(Calendar cal) throws SQLException {

View Full Code Here
   1: 
   2: import java.sql.Timestamp;
   3: 
   4:         ...
   5:             int digit = Integer.parseInt(
   6:                 String.valueOf(number.charAt(count)));
   7:                 digit *= 2;
   8:         ...
   9: 
  10:     public static Timestamp NULL_TIMESTAMP = new Timestamp(NULL_TIME);
  11: 
  12:         ...
  13:         else try {
  14:             return Timestamp.valueOf(string);

View Full Code Here
   1: import java.sql.Time;
   2: import java.sql.Timestamp;
   3: import java.sql.SQLException;
   4:         ...
   5:             if (val.length() > 10) {
   6:                 Timestamp ts = PGDateTimeTypes.textToTimestamp(val);
   7:         ...
   8:                 return Date.valueOf(ts.toString().substring(0, 10));
   9:             } else {
  10:         ...
  11:                 return Date.valueOf(val);

View Full Code Here
   1:                                     String        CustomerID,
   2:                                     Timestamp  DateTime
   3:                                   ) throws SQLException
   4:         ...
   5:                                     String CustomerID,
   6:                                     Timestamp DateTime
   7:                                   ) throws SQLException
   8:         ...
   9:                                           CustomerID, 
  10:                                           Timestamp.valueOf(Date + " " + Time));

View Full Code Here
   1:                                     String        CustomerID,
   2:                                     Timestamp  DateTime
   3:                                   ) throws SQLException
   4:         ...
   5:                                     String CustomerID,
   6:                                     Timestamp DateTime
   7:                                   ) throws SQLException
   8:         ...
   9:                                           CustomerID, 
  10:                                           Timestamp.valueOf(Date + " " + Time));

View Full Code Here
   1: 
   2:     public static Timestamp getParameterAsDate (HttpServletRequest request, 
   3:         String parameter)
   4:         ...
   5:     
   6:     public static Timestamp getParameterAsDate (HttpServletRequest request, 
   7:         String parameter, Language language)
   8:         ...
   9:                 if (date != null)
  10:                     return new Timestamp (date.getTime());
  11:             }
  12:         ...
  13:         {
  14:             return Timestamp.valueOf(data);

View Full Code Here
   1:       try {
   2:         return java.sql.Date.valueOf(tmp);
   3:       } catch (Exception e2) {
   4:         ...
   5: 
   6:   public static java.sql.Timestamp parseTimestamp(String tmp) {
   7:     return parseTimestamp(tmp, Locale.getDefault());
   8:         ...
   9: 
  10:   public static java.sql.Timestamp parseTimestamp(String tmp, Locale locale) {
  11:         ...
  12:     java.sql.Timestamp timestampValue = null;

View Full Code Here
   1: 
   2:     public static void setContext (Properties ctx, String context, Timestamp value)
   3:     {
   4:         ...
   5:         s_log.finer("Context " + context + "==" + value);
   6:         ctx.setProperty(context, String.valueOf(value));
   7: 
   8:         ...
   9: 
  10:     public static void setContext (Properties ctx, int WindowNo, String context, Timestamp value)
  11:     {
  12:         ...
  13:             s_log.finer("Context("+WindowNo+") " + context + "==" + value);
  14:         ctx.setProperty(WindowNo+"|"+context, String.valueOf(value));

View Full Code Here
   1:         "SELECT,SESSION_USER,SET,SMALLINT,SQRT,SUBSTRING,"+
   2:         "SUM,SYSDATE,TABLE,TEMP,TEXT,TIME,TIMESTAMP,TINYINT,"+
   3:         "TO,TOP,TRAILING,TRIGGER,TRIM,TRUE,UCASE,UNION,"+
   4:         ...
   5:         s=s.substring(1,s.length()-1);
   6:         java.sql.Date.valueOf(s);
   7:         return s;
   8:         ...
   9:         s=s.substring(1,s.length()-1);
  10:         java.sql.Timestamp.valueOf(s);
  11:         return s;
  12:         ...
  13:         case SQLTokenTypes.TYPE_DATETIME:
  14:             datatype=Types.TIMESTAMP;

View Full Code Here
   1:     private final static java.math.BigDecimal bdMaxByteValue__ =
   2:             java.math.BigDecimal.valueOf(Byte.MAX_VALUE);
   3:     private final static java.math.BigDecimal bdMinByteValue__ =
   4:         ...
   5:             java.math.BigDecimal.valueOf(Byte.MIN_VALUE);
   6:     private final static java.math.BigDecimal bdMaxShortValue__ =
   7:         ...
   8:             java.math.BigDecimal.valueOf(Short.MAX_VALUE);
   9:     private final static java.math.BigDecimal bdMinShortValue__ =
  10:         ...
  11: 
  12:         case java.sql.Types.TIMESTAMP:

View Full Code Here
   1: import java.sql.PreparedStatement;
   2: import java.sql.Timestamp;
   3: 
   4:         ...
   5: 
   6:   public static String getDateString(Timestamp timeStamp) {
   7: 
   8:         ...
   9:     dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
  10:     return Timestamp.valueOf(dateFormat.format(time.getTime()));
  11:   }
  12:         ...
  13:     String value = EchoProperties.getProperty(property);
  14:     int length = Integer.valueOf(value).intValue();

View Full Code Here
   1: import java.sql.Time;
   2: import java.sql.Timestamp;
   3: import java.sql.Types;
   4:         ...
   5:         put("time",time.instance);
   6:         put("timestamp",timestamp.instance);
   7:         put("timestamptz",timestamptz.instance);
   8:         ...
   9:             @ifjdbc1@
  10:         return Float.valueOf(pctx.getString(data)).floatValue();
  11:             @fijdbc1@
  12:         ...
  13:                 @ifjdbc1@
  14:                 return Double.valueOf(pctx.getString(data)).doubleValue();

View Full Code Here