Results 1 to 3 of 3
  1. #1
    marjune is offline Member
    Join Date
    Feb 2012
    Location
    Philippines
    Posts
    1
    Rep Power
    0

    Default Resultset to array

    hello fellaz, the thing that killing me was very simple i think...
    what i need to do right now is to get the data from mysql table and then stored it into array..
    so that i can dispaly it in Jtable... just like this

    String colums[] = {"First Name", "Last Name"};
    Object rows[][];

    int ctr = 0;
    while(rs.next()){

    rows[ctr][0] = rs.getString("fname");
    rows[ctr][0] = rs.getString("lname");
    ctr++;

    }
    userTable = new JTable(rows, columns);

    but it doesn't work...
    please help


    thanks
    marjune

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: Resultset to array

    "it doesn't work" tells us almost nothing of any use.
    What doesn't work?
    Errors?
    Exceptions?
    Stack traces?

    Information!
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Resultset to array

    Quote Originally Posted by Tolls View Post
    What doesn't work?
    Errors?
    Exceptions?
    Stack traces?
    Lazy?
    Good-for-nothing?
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 3
    Last Post: 08-08-2011, 06:07 PM
  2. ResultSet to array
    By Jojomofoman in forum New To Java
    Replies: 2
    Last Post: 01-08-2011, 10:10 PM
  3. Help with Resultset
    By xxAlemanxx in forum JDBC
    Replies: 6
    Last Post: 06-24-2008, 12:09 PM
  4. ResultSet to XML
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-14-2008, 10:50 AM
  5. ResultSet example
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-20-2008, 09:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •