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

void com::mysql::jdbc::ServerPreparedStatement::setDate ( int  parameterIndex,
Date  x,
Calendar  cal 
) throws SQLException [inline]

Set a parameter to a java.sql.Date value. The driver converts this to a SQL DATE value when it sends it to the database.

parameterIndex the first parameter is 1, the second is 2, ...
x the parameter value
cal the calendar to interpret the date with
SQLException if a database-access error occurs.

Definition at line 1851 of file ServerPreparedStatement.java.

References getBinding(), and setNull().

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

                  binding.value = x;
                  binding.isNull = false;
                  binding.isLongData = false;

Generated by  Doxygen 1.6.0   Back to index