Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void populateTable (){
- try{
- Class.forName("com.mysql.jdbc.Driver").newInstance();
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/Proiect", "root" , "5416dif!!");
- PreparedStatement pst= con.prepareStatement("select codd, nume, artist, categorie, data_lansare, pret from discuri;");
- ResultSet rs=pst.executeQuery();
- this.jTable1.setModel(DbUtils.resultSetToTableModel(rs));
- }
- catch(Exception exc){
- exc.printStackTrace();};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement