Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. public class Reset_Table1 {
  2.     private Component frame;
  3.     {
  4.         try {
  5.             Connection connection=null;
  6.             dbConnection obj_dbConnection=new dbConnection();
  7.             connection=obj_dbConnection.getConnection();
  8.             ResultSet rs=null;
  9.  
  10.             String query = "TRUNCATE TABLE device_1";
  11.             connection.createStatement().execute(query);
  12.  
  13.             System.out.println("device_1 deleted");
  14.             JOptionPane.showMessageDialog(frame,
  15.                     "Reseted");
  16.         } catch (SQLException e) {
  17.             JOptionPane.showMessageDialog(frame,
  18.                     "Reset failed",
  19.                     "Reset failed",
  20.                     JOptionPane.ERROR_MESSAGE);
  21.             e.printStackTrace();
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement