time stamp add.

@param parsedArgs arguments
@return sql call
@throws SQLException if something wrong happens
552784
public static String sqltimestampadd(List<?> parsedArgs) throws SQLException {
    if (parsedArgs.size() != 3) {
      throw new PSQLException(
          GT.tr("{0} function takes three and only three arguments.", "timestampadd"),
          PSQLState.SYNTAX_ERROR);
    }
    String interval = EscapedFunctions.constantToInterval(parsedArgs.get(0).toString(),
        parsedArgs.get(1).toString());
    StringBuilder buf = new StringBuilder();
    buf.append("(").append(interval).append("+");
    buf.append(parsedArgs.get(2)).append(")");
    return buf.toString();
  }
216198
public void setTimestamp( String parameterName, Timestamp value ) throws OdaException
	{
		// only applies to named input parameter
		parameters.put(parameterName, value);
	}
913872
@Override
	public void updateTimestamp(final String columnLabel, final Timestamp x) throws SQLException {
		wrapped.updateTimestamp(columnLabel, x);
	}
1148760
public static void sqldatabase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    zeroArgumentFunctionCall(buf, "current_database()", "database", parsedArgs);
  }
794715
public static void sqlcurdate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    zeroArgumentFunctionCall(buf, "current_date", "curdate", parsedArgs);
  }
720568
public static void sqlweek(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "extract(week from ", "week", parsedArgs);
  }
591276
@Override
    public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
        internalStmt.setTimestamp(parameterIndex, x);
    }
773532
@Override
    public void setTimestamp(String parameterName, Timestamp x) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
801863
protected void addUserDateCreated(CmsSetupDb dbCon) throws SQLException {

        System.out.println(new Exception().getStackTrace()[0].toString());
        // Add the column to the table if necessary
        if (!dbCon.hasTableOrColumn(CMS_USERS_TABLE, USER_DATECREATED)) {
            String addUserDateCreated = readQuery(QUERY_ADD_USER_DATECREATED_COLUMN);
            dbCon.updateSqlStatement(addUserDateCreated, null, null);

            String setUserDateCreated = readQuery(QUERY_SET_USER_DATECREATED);
            List<Object> param = new ArrayList<Object>();
            // Set the creation date to the current time
            param.add(new Long(System.currentTimeMillis()));

            dbCon.updateSqlStatement(setUserDateCreated, null, param);
        } else {
            System.out.println("column " + USER_DATECREATED + " in table " + CMS_USERS_TABLE + " already exists");
        }
    }
1368057
public static void updateBatch(String sql, Object[][] arg) {
        Connection connection = JDBCUtils.getConnection();
        PreparedStatement ps = null;
        try {
            ps = connection.prepareStatement(sql);
            for (int i = 0; i < arg.length; i++) {
                for (int j = 0; j < arg[i].length; j++) {
                    ps.setObject(j + 1, arg[i][j]);
                }
                ps.addBatch();
            }
            ps.executeBatch();
        } catch (SQLException e) {
            e.printStackTrace();
        }

        JDBCUtils.release(ps, connection);
    }
1088892
@Override
	public Timestamp getTimestamp(final int columnIndex, final Calendar cal) throws SQLException {
		return wrapped.getTimestamp(columnIndex, cal);
	}
543182
public Object[] call(Sql sql) throws SQLException {
		
		long start =  System.currentTimeMillis();
		
		if (sql.validate() == false) {
			return null;
		}
		
		List<Object> result = new ArrayList<Object>();
		
		Statement stmt = null;
		try {
			stmt = this.createStatment(conn, sql);
			if (stmt instanceof CallableStatement) {
				CallableStatement callStmt = (CallableStatement)stmt;
				callStmt.execute();
				List<Object> tmpResults = this.getProcedureOutValue(callStmt, sql);
				for (Object tmpResult : tmpResults) {
					if (tmpResult instanceof ResultSet) {
						result.add(getResultSet((ResultSet)tmpResult));
					} else {
						result.add(tmpResult);
					}
				}
			}
		} catch (SQLException e) {
			throw e;
		} finally {
			try {
				if (stmt != null && stmt.isClosed() == false) {
					stmt.close();
				}
			} catch (SQLException e) {
				logger.error(e.getMessage(), e);
			}
		}
		
		logger.debug(String.format("Execute %s used %d ms", sql.getSql(), System.currentTimeMillis() - start));
		
		return result.toArray();
	}
11028
public void bindArgument(@NotNull PreparedStatement ps, int index, @Nullable Object value) throws SQLException {
        ArgumentBinder.bindArgument(ps, index, value);
    }
341192
public static String sqlsubstring(List<?> parsedArgs) throws SQLException {
    if (parsedArgs.size() == 2) {
      return "substr(" + parsedArgs.get(0) + "," + parsedArgs.get(1) + ")";
    } else if (parsedArgs.size() == 3) {
      return "substr(" + parsedArgs.get(0) + "," + parsedArgs.get(1) + "," + parsedArgs.get(2)
          + ")";
    } else {
      throw new PSQLException(GT.tr("{0} function takes two or three arguments.", "substring"),
          PSQLState.SYNTAX_ERROR);
    }
  }
506969
public static int update(String sql, Object... args) {
		int result = 0;
		Connection con = getconnnection();
		PreparedStatement ps = null;
		try {
			ps = con.prepareStatement(sql);
			if (args != null) {
				for (int i = 0; i < args.length; i++) {
					ps.setObject((i + 1), args[i]);
				}
			}
			result = ps.executeUpdate();
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			close(ps, con);
		}

		return result;
	}
143032
public void setTimestamp(String fieldName, Timestamp value) {
		if (value == null) {
			throw new IllegalArgumentException("参数值[" + fieldName + "]不能为NULL.");
		}
		fieldList.add(fieldName);
		statementParameter.setTimestamp(value);
	}
335979
public static void sqllog10(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "log(", "log10", parsedArgs);
  }