I want to get all table name which is in database and display it in JTable
.
It is printing:
con = DriverManager.getConnection("jdbc:h2:C:/SimpleGST/GST/INVOICES","sa","");
String[] types = {"TABLE"};
DatabaseMetaData metadata = con.getMetaData();
ResultSet resultSet = metadata.getTables(null, null, "%", types);
while (resultSet.next()) {
String tableName = resultSet.getString(3);
System.out.println(tableName);
table.setModel(net.proteanit.sql.DbUtils.resultSetToTableModel(resultSet));
}
It is printing the table names but it's not displaying in the table.