Results 1 to 3 of 3
  1. #1
    Azuxard is offline Member
    Join Date
    Mar 2009
    Posts
    5
    Rep Power
    0

    Default How do I put a ResultSet in an Object?

    Hi!
    I have put a query from sql server 2005 in a result set:

    rs = st.executeQuery("select * from category ");

    where rs is a ResultSet and st is Statement.

    Now I have to put the resultset in an Object[][] in order to use it in a JTable.

    How can I do that?

    Since now, Thanks!

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    7

    Default

    Object[][] should store the data fetched, not the whole ResultSet object

    use rs.getXXX(int/String) to get the data in the result

  3. #3
    Azuxard is offline Member
    Join Date
    Mar 2009
    Posts
    5
    Rep Power
    0

Similar Threads

  1. Replies: 2
    Last Post: 11-26-2010, 03:12 AM
  2. Replies: 1
    Last Post: 03-04-2009, 07:14 PM
  3. Either ResultSet or a specific object?
    By saul_2110 in forum JDBC
    Replies: 3
    Last Post: 12-06-2008, 08:41 AM
  4. Replies: 1
    Last Post: 07-22-2008, 05:27 PM
  5. Help with Resultset
    By xxAlemanxx in forum JDBC
    Replies: 6
    Last Post: 06-24-2008, 12:09 PM

Posting Permissions

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