y { java.sql.Connection con = DriverManager.getConnection ("jdbc:mysql://localhost:3306/test","root",""); String query = "Select distinct * from test"; Statement statement = (Statement) con.createStatement(); ResultSet rs= statement.executeQuery(query); while(rs.next()) { String name = rs.getString("name"); String age= rs.getString("age"); String number= rs.getString("number"); model.addRow(new Object[]{name, age, number}); } table.setModel(model); } catch(Exception e){ JOptionPane.showMessageDialog(null, "failes"); }
WHERE
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)