|
|
最初由 RobinOuyang 发布
[B]setdate()为何物,我还一直没有用过,不知那位大侠可以介绍一下。 [/B]
PreparedStatement的方法
/**
* Sets the designated parameter to a <code<java.sql.Date</code> value.
* The driver converts this
* to an SQL <code>DATE</code> value when it sends it to the database.
*
* @param parameterIndex the first parameter is 1, the second is 2, ...
* @param x the parameter value
* @exception SQLException if a database access error occurs
*/
void setDate(int parameterIndex, java.sql.Date x)
throws SQLException;
/**
* Sets the designated parameter to the given <code>java.sql.Date</code> value,
* using the given <code>Calendar</code> object. The driver uses
* the <code>Calendar</code> object to construct an SQL <code>DATE</code> value,
* which the driver then sends to the database. With a
* a <code>Calendar</code> object, the driver can calculate the date
* taking into account a custom timezone. If no
* <code>Calendar</code> object is specified, the driver uses the default
* timezone, which is that of the virtual machine running the application.
*
* @param parameterIndex the first parameter is 1, the second is 2, ...
* @param x the parameter value
* @param cal the <code>Calendar</code> object the driver will use
* to construct the date
* @exception SQLException if a database access error occurs
* @since 1.2
* @see <a href="package-summary.html#2.0 API">What Is in the JDBC
* 2.0 API</a>
*/
void setDate(int parameterIndex, java.sql.Date x, Calendar cal)
throws SQLException; |
|