Jtable does not display the 1st row of my DB table,
below is my code to populate the jtable -
below is my code to populate the jtable -
Code:
try { Class.forName("com.mysql.jdbc.Driver"); String conURL = "jdbc:mysql://localhost/biometric"; Connection con = DriverManager.getConnection(conURL, "root", "root"); Statement st = con.createStatement(); String query = "select sl,enrolladdr,employee_name from employee_details "; ResultSet rs = st.executeQuery(query); System.out.println(query); if (rs.next()) { Mymodel model = (Mymodel) MyDbUtils.resultSetToTableModel(rs); jTable1.setModel(model); } } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); }
Comment