Use of Rs. Previous () When querying records
If a data table is queried, a prompt is displayed if there are no records, and all query results are displayed. If there is a query result, you need to perform two queries. After the first query, the Record Pointer Points to the last record. Before the second query, you need to return the pointer to the first record (using RS. previous (), marked in red using RS. the method used to set the record pointer must be used in the previous () method. Statement stat = con. createstatement (resultset. type_scroll_insensitive, resultset. concur_read_only ); Resultset rs = NULL; string SQL = "select * from Teacher"; rs1_stat.exe cutequery (SQL ); If (! Rs. Next ()) { Out. println ("Sorry, there is no basic instructor information record you want to query "); } Else { Rs. Previous (); While (Rs. Next ()){......}} |
|
|
Use of Rs. Previous () When querying records