Bind data from database in jtable with the help of rs2xml.jar


 try
    {
      Connection c=new Connection();
            java.sql.Connection con=c.connectit();
    String sql="select id as ID,BrandName,VendorName,Description,Quantity,Category,Size,Color,PurchaseDate,SellingPrice,Product,Discount from stock";
    PreparedStatement pst=con.prepareStatement(sql);
    ResultSet rs=pst.executeQuery(sql);
    stock.setModel(DbUtils.resultSetToTableModel(rs));
con.close();
pst.close();
    }
    catch(Exception e)
    {
        JOptionPane.showMessageDialog(null,e);
    }
  

Popular posts from this blog

Simple Sign up design. Android.

Cart page design in android.

Set Date on jDateChooser and retrieve record from database.