title: Save edited cell/s from JTable to database
body: <p>Newbie to JTable. Just got in today.
  So I am able to populate my data from database into a JTable.
  I am currently stuck in saving the edited cell/s into the database.</p>
  
  <p>I've read many articles. But I haven't found the one</p>
  
  <p>Just a button then save!</p>
  
  <p>Here's my code</p>
  
  <pre><code>public class DBEngine {
  Connection con = IQConnection.getConnectionMgrInstance().getConnection();
  PreparedStatement pstm = null;
  ResultSet rs = null;
  
  public Vector getEmployee() throws Exception{
      Vector&lt;Vector&lt;String&gt;&gt; employeeVector = new Vector&lt;Vector&lt;String&gt;&gt;();
  
      try {          
  
          if (con != null) {
  
             String query = "SELECT * FROM OGG.TBLSAMPLE";
  
  
              try {
                  pstm = con.prepareStatement(query);
                  rs = pstm.executeQuery();
  
  
                  while(rs.next()) {
                     Vector&lt;String&gt; employee = new Vector&lt;String&gt;();
                      employee.add(rs.getString(1)); //Empid
                      employee.add(rs.getString(2)); //name
                      employee.add(rs.getString(3)); //position
                      employee.add(rs.getString(4)); //department
                      employeeVector.add(employee);
                  }   
  
  
  
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }else{
              //lbl_err1.setText("Error");
          }
  
      } catch (Exception e) {
  
          e.printStackTrace();
          //flag = false;
          //lbl_err1.setText("Failed!");
      } finally {
  
          try{
              if(rs != null){
                  rs.close();
              }
          }catch(Exception e){
  
          }
  
          try{
              if(pstm != null){
                  pstm.close();
              }
          }catch(Exception e){
  
          }    
      }
     return employeeVector;
  }
  }
  </code></pre>
  
  <p>Thanks!</p>