Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. americanoSmall.addActionListener(
  2. new ActionListener()
  3. {
  4. public void actionPerformed(ActionEvent e)
  5. {
  6. try {
  7. String query = "select ProductName, Price from product where ProductID = 24";
  8. java.sql.PreparedStatement pst = connection.prepareStatement(query);
  9. ResultSet rs = pst.executeQuery();
  10. table.setModel(DbUtils.resultSetToTableModel(rs));
  11.  
  12. } catch (Exception e1)
  13. {
  14. e1.printStackTrace();
  15. }
  16. }
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement