void setTimestamp(Object parameterIndex, java.sql.Timestamp x, java.util.Calendar cal) throws SQLException { if (cal == null || x == null) { setObject(parameterIndex, x); return; } // set the parameter on the stored procedure setObject(parameterIndex, TimestampWithTimezone.createTimestamp(x, cal.getTimeZone(), getDefaultCalendar())); }
void setTime(Object parameterIndex, java.sql.Time x, java.util.Calendar cal) throws SQLException { if (cal == null || x == null) { setObject(parameterIndex, x); return; } // set the parameter on the stored procedure setObject(parameterIndex, TimestampWithTimezone.createTime(x, cal.getTimeZone(), getDefaultCalendar())); }
void setDate(Object parameterIndex, java.sql.Date x ,java.util.Calendar cal) throws SQLException { if (cal == null || x == null) { setObject(parameterIndex, x); return; } // set the parameter on the stored procedure setObject(parameterIndex, TimestampWithTimezone.createDate(x, cal.getTimeZone(), getDefaultCalendar())); }
void setTime(Object parameterIndex, java.sql.Time x, java.util.Calendar cal) throws SQLException { if (cal == null || x == null) { setObject(parameterIndex, x); return; } // set the parameter on the stored procedure setObject(parameterIndex, TimestampWithTimezone.createTime(x, cal.getTimeZone(), getDefaultCalendar())); }
void setDate(Object parameterIndex, java.sql.Date x ,java.util.Calendar cal) throws SQLException { if (cal == null || x == null) { setObject(parameterIndex, x); return; } // set the parameter on the stored procedure setObject(parameterIndex, TimestampWithTimezone.createDate(x, cal.getTimeZone(), getDefaultCalendar())); }
void setTimestamp(Object parameterIndex, java.sql.Timestamp x, java.util.Calendar cal) throws SQLException { if (cal == null || x == null) { setObject(parameterIndex, x); return; } // set the parameter on the stored procedure setObject(parameterIndex, TimestampWithTimezone.createTimestamp(x, cal.getTimeZone(), getDefaultCalendar())); }
void setObject(Object parameterIndex, Object value) throws SQLException { if (parameterIndex instanceof String) { String s = (String)parameterIndex; if (paramsByName == null) { paramsByName = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER); ParameterMetaDataImpl pmdi = getParameterMetaData(); for (int i = 1; i <= pmdi.getParameterCount(); i++) { String name = pmdi.getParameterName(i); paramsByName.put(name, i); } } parameterIndex = paramsByName.get(s); if (parameterIndex == null) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMCallableStatement.Param_not_found", s)); //$NON-NLS-1$ } } if ((Integer)parameterIndex < 1) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMPreparedStatement.Invalid_param_index")); //$NON-NLS-1$ } if(parameterMap == null){ parameterMap = new TreeMap<Integer, Object>(); } if (serverCalendar != null && value instanceof java.util.Date) { value = TimestampWithTimezone.create((java.util.Date)value, getDefaultCalendar().getTimeZone(), serverCalendar, value.getClass()); } parameterMap.put((Integer)parameterIndex, value); }
/** * <p>MMPreparedStatement constructor. * @param Driver's connection object. * @param String object representing the prepared statement */ PreparedStatementImpl(ConnectionImpl connection, String sql, int resultSetType, int resultSetConcurrency) throws SQLException { super(connection, resultSetType, resultSetConcurrency); if (sql == null) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMPreparedStatement.Err_prep_sql")); //$NON-NLS-1$ } this.prepareSql = sql; TimeZone timezone = connection.getServerConnection().getLogonResult().getTimeZone(); if (timezone != null && !timezone.hasSameRules(getDefaultCalendar().getTimeZone())) { this.serverCalendar = Calendar.getInstance(timezone); } }
void setObject(Object parameterIndex, Object value) throws SQLException { if (parameterIndex instanceof String) { String s = (String)parameterIndex; if (paramsByName == null) { paramsByName = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER); ParameterMetaDataImpl pmdi = getParameterMetaData(); for (int i = 1; i <= pmdi.getParameterCount(); i++) { String name = pmdi.getParameterName(i); paramsByName.put(name, i); } } parameterIndex = paramsByName.get(s); if (parameterIndex == null) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMCallableStatement.Param_not_found", s)); //$NON-NLS-1$ } } if ((Integer)parameterIndex < 1) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMPreparedStatement.Invalid_param_index")); //$NON-NLS-1$ } if(parameterMap == null){ parameterMap = new TreeMap<Integer, Object>(); } if (serverCalendar != null && value instanceof java.util.Date) { value = TimestampWithTimezone.create((java.util.Date)value, getDefaultCalendar().getTimeZone(), serverCalendar, value.getClass()); } parameterMap.put((Integer)parameterIndex, value); }
/** * <p>MMPreparedStatement constructor. * @param Driver's connection object. * @param String object representing the prepared statement */ PreparedStatementImpl(ConnectionImpl connection, String sql, int resultSetType, int resultSetConcurrency) throws SQLException { super(connection, resultSetType, resultSetConcurrency); if (sql == null) { throw new TeiidSQLException(JDBCPlugin.Util.getString("MMPreparedStatement.Err_prep_sql")); //$NON-NLS-1$ } this.prepareSql = sql; TimeZone timezone = connection.getServerConnection().getLogonResult().getTimeZone(); if (timezone != null && !timezone.hasSameRules(getDefaultCalendar().getTimeZone())) { this.serverCalendar = Calendar.getInstance(timezone); } }