0
david posted
how to convert resultSet To TableModel in Java Swing ?
coding my first application for Swing (Java)trying to fetch the result from MySQL and loading it to JTable
i have done
dataTable = new javax.swing.JTable();
try {
Class.forName(driver);
conn = DriverManager.getConnection(url, user, password);
System.out.println("connected");
CallableStatement cs = conn.prepareCall("select id,title from employee");
ResultSet rs = cs.executeQuery();
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Now how to apply resultSet in setModel(TableModel dataModel)
need to convert resultSet To TableModel in Java Swing ? how to do it ?