| setDate ( index, date ) | ใช้กำหนดข้อมูลที่เป็นประเภท date ณ ตำแหน่ง ที่กำหนด |
|---|
method:setDate ( index, date )
return type:void
content:ใช้กำหนดข้อมูลที่เป็นประเภท date ณ ตำแหน่ง ที่กำหนด
example:Class.forName ( "sun.jdbc.odbc.JdbcOdbcDriver" ); Connection conn = DriverManager.getConnection ( "jdbc:odbc:Nutt" ); String sql = "SELECT * FROM person WHERE dateborn = ?"; PreparedStatement pstat = conn.preparedStatement ( sql, ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY ); pstat.setDate ( 0, new Date() ); Result rs = pstat.executeQuery ( );