[nbusers] how to display "select" query

  • From: "adhi" < >
  • To:
  • Subject: [nbusers] how to display "select" query
  • Date: Mon, 08 Mar 2010 01:06:32 +0000

hi..
first, i'm not good in english
so i'm sorry if my question is not understandable.. :P 
====================
i want to display all data in one table
but...if i use this code
----------------------
try {
      Statement stmt;
      ResultSet rsult;
      Class.forName("com.mysql.jdbc.Driver");
      String url =
            "jdbc:mysql://localhost:3306/dbfinance";
      Connection con =
                     DriverManager.getConnection(
                                 url,"root", "password");
      stmt = con.createStatement();
      rsult= stmt.executeQuery("SELECT * FROM `finance1`");
       while (rsult.next()) {
           String tipe_input = rsult.getString("tipe_input");
           String input      = rsult.getString("input");
           jTextField1.setText(tipe_input + input);
           }
       con.close();}
        catch( Exception salah ) {
        salah.printStackTrace();}
---------------------------
j Text Field only display the last row of the data that i wanted
any advice?

thanx before..  [Rolling Eyes]

------------------------
just do it !!






[nbusers] how to display "select" query

adhi 03/08/2010

[nbusers] Re: how to display "select" query

Mark Wade 03/08/2010

[nbusers] Re: how to display "select" query

Witold Szczerba 03/08/2010

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close