Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: From query to JTable

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default From query to JTable

    In Netbeans I'm using a JTable to display data from a db table. How can I bind the JTable to the results of a query (resultset)?

    Here is how I create the recordset:


    String host = "jdbc:derby://localhost:1527/TownHall";
            String uName = "test";
            String uPass= "111";
            try{
            Connection con = DriverManager.getConnection( host, uName, uPass );
            Statement stmt = con.createStatement( );
            String SQL = "SELECT * FROM TAXES";
            ResultSet rs = stmt.executeQuery( SQL );


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: From query to JTable

    I don't know how you mean by binding JTable with with the ResultSet.

  3. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: From query to JTable

    This thread has been cross posted here:

    http://www.java-forums.org/jdbc/56388-query-jtable.html

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting

    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Query on jtable and ireport
    By Samrudhi in forum Member Introductions
    Replies: 0
    Last Post: April 20th, 2011, 04:38 AM
  2. update query is firing first then insert query
    By salmondavid88 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 8th, 2011, 10:15 AM
  3. Query
    By amol_kale in forum JDBC & Databases
    Replies: 0
    Last Post: February 18th, 2011, 07:04 AM
  4. SQL query not working
    By mjpam in forum What's Wrong With My Code?
    Replies: 11
    Last Post: September 28th, 2010, 05:15 PM
  5. MSSQL Query Question
    By sravyen in forum JDBC & Databases
    Replies: 1
    Last Post: October 13th, 2009, 02:47 AM