title: data not added into vector variable
body: <p>the vector variable that can't fetch element from another vector variable.</p>
  
  <pre><code>public class DealerView_GUI extends javax.swing.JInternalFrame {
  
      /**
       * Creates new form DealerView
       */
      String s;
      private Vector&lt;Vector&lt;String&gt;&gt; data;
     private Vector&lt;String&gt; header;
     DB db = new DB();
      public DealerView_GUI() {
          String[][] dfg = null;
          Connection con = db.getConnection();
          ResultSet rs = null;
          Object[][] dataR = null;
          try
          {
          PreparedStatement ps = con.prepareStatement("SELECT * FROM TEMP_TBL");
          rs = ps.executeQuery();
          ResultSetMetaData metaData = rs.getMetaData();
          int columns = metaData.getColumnCount();
          int cv = 0;
          while(rs.next())
          {
              Vector&lt;String&gt; row = new Vector&lt;String&gt;(columns);
              String s = rs.getString("FIRST_NAME");
              for (int i = 1; i &lt;= columns; i++) {
                  row.addElement(s);
              }
              data.addElement(row);
              cv++;
          }
          header = new Vector&lt;String&gt;();        
          header.add("Dealer Id");
          header.add("Dealer Name");
          header.add("Phone");
          header.add("Place");
          header.add("Paid Amount");
          header.add("Unpaid Amount");
  
          }
          catch(SQLException ex)
          {
              LogManager.logErr(ex);
          }
          initComponents();
          DefaultTableModel dm;
          dm = (DefaultTableModel)serachedDealer_jTable.getModel();
          serachedDealer_jTable.setModel(new javax.swing.table.DefaultTableModel(data,header){
          boolean[] canEdit = new boolean [] {
          false, false, false, false, false, false
      };
  
      public boolean isCellEditable(int rowIndex, int columnIndex) {
          return canEdit [columnIndex];
      }
          });
  
      }
  }
  </code></pre>
  
  <p>the error shows in run time for the line of 'data.addElement(row);'.
  the vector variable(data) shows the null pointer exception.</p>