title: Fetch data from database into Jtextfield when One Jtextfield is Typed
body: <p>Hi Guys I have a Swing Application that is connected to an oracle database, I want it such that Once I type a Value into the JTextField, the other JTextfields on the JFrame are loaded with subsequent data from the database but I do not seem to achieve this. I have tried the Following code but it fetched nothing.</p>
  
  <pre><code>txtNo.addKeyListener(new KeyAdapter() {
          public void keyTyped(KeyEvent ke) {
              Connection conn = null;
              try{
                  Class.forName("oracle.jdbc.driver.OracleDriver");
  
          conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "Username", "Password");
          Statement st = conn.createStatement();
          String load = "Select * from Store_info_table where PART_NUMBER = '" + txtNo.getText() + "'";
          ResultSet rs = st.executeQuery(load);
          while(rs.next()){
              txtName.setText(rs.getString("SPARE_DESC"));
          }
              }catch(Exception ae){
  
              }
          }
      });
  </code></pre>