title: Retrieve from database into JLabel
body: <p>I want to retrieve data from database and display into JLabels .I am working in Netbeans and i have done this..</p>
  
  <pre><code>private void showActionPerformed(java.awt.event.ActionEvent evt) {                                     
    int row=jTable1.getSelectedRow();
    int column=jTable1.getSelectedColumn();
      String str=(String)jTable1.getValueAt(row,column); 
  
      try{
      rs=stat.executeQuery("select * from table3 where e_id='"+str+"'");
  
      jLabel1.setText(rs.getString("name"));
      jLabel12.setText(rs.getString("e_id"));
  
      }
      catch(Exception e)
      {System.out.print(e);}
  
  
  }   
  </code></pre>
  
  <p>Its unable to display anything.
  I tried this in notepad and its working fine but not in netbeans.<br>
  Any help is appreciated.</p>