0

how to get a row data with row number in a table of database with java?

int x = Jtable.getSelectedRow() - 1; resultSet = statement.executeQuery("SELECT * FROM tbl_mavad LIMIT '"+x+"',1"); //select a row in jtable and get selected row number or index (int x) and then get row data (int x) in database . how?

11th Jun 2017, 7:33 PM
hamid
hamid - avatar
1 Respuesta
+ 1
it's not possible this way. row numbers using LIMIT are generated randomly and are not stored anywhere, so cannot be used to link back. if using oracle or mysql, use rowid which is unique reference to any record in database
17th Jun 2017, 10:18 PM
Gurpreet Singh
Gurpreet Singh - avatar