Logo Search packages:      
Sourcecode: mysql-connector-java version File versions  Download package

void com::mysql::jdbc::ServerPreparedStatement::setTimeInternal ( int  parameterIndex,
java.sql.Time  x,
Calendar  targetCalendar,
TimeZone  tz,
boolean  rollForward 
) throws SQLException [inline]

Set a parameter to a java.sql.Time value. The driver converts this to a SQL TIME value when it sends it to the database, using the given timezone.

parameterIndex the first parameter is 1...));
x the parameter value
tz the timezone to use
SQLException if a database access error occurs

Definition at line 2069 of file ServerPreparedStatement.java.

References com::mysql::jdbc::StatementImpl::connection, getBinding(), com::mysql::jdbc::StatementImpl::getCalendarInstanceForSessionOrNew(), com::mysql::jdbc::ConnectionImpl::getServerTimezoneTZ(), and setNull().

Referenced by setTime().

            if (x == null) {
                  setNull(parameterIndex, java.sql.Types.TIME);
            } else {
                  BindValue binding = getBinding(parameterIndex, false);
                  setType(binding, MysqlDefs.FIELD_TYPE_TIME);

                  Calendar sessionCalendar = getCalendarInstanceForSessionOrNew();
                  synchronized (sessionCalendar) {
                        binding.value = TimeUtil.changeTimezone(this.connection, 
                                    x, tz,
                  binding.isNull = false;
                  binding.isLongData = false;

Generated by  Doxygen 1.6.0   Back to index