Results 1 to 2 of 2

Thread: JTable

  1. #1
    skuskusas is offline Member
    Join Date
    Aug 2012
    Posts
    5
    Rep Power
    0

    Question JTable

    Hi here i get all rows from from DB. I want get sss = rs.getInt(5); from DB ant set to Colheads.

    or no to column but to first Row all data from column;
    Exsample
    Java Code:
    now table is  table  a    me need        a  a+1   a3   a4 ....
                         1                   1   2     3     4   .....
                         2
                         3
                         4
    Java Code:
    p2 = new JPanel();
            try {
                rs = st.executeQuery("SELECT * from item");
            } catch (SQLException ex) {
                Logger.getLogger(nn.class.getName()).log(Level.SEVERE, null, ex);
            }
            try {
                while (rs.next()) {
                    s = rs.getInt(1);
                    a = rs.getString(2);
                    ss = rs.getInt(3);
                    aa = rs.getString(4);
                    sss = rs.getInt(5);
                    ssss = rs.getInt(6);
                    rows++;
                }
                data1 = new Object[rows][6];
                Object[] Colheads = {"Isss = rs.getInt(5) here need some help !!!!!!!!!!"};
                rs = st.executeQuery("Select * from item");
                for (int i1 = 0; i1 < rows; i1++) {
                    rs.next();
                    for (int j1 = 0; j1 < 6; j1++) {
                        data1[i1][j1] = rs.getString(j1 + 1);
                      
                    }
                }
    Last edited by skuskusas; 09-05-2012 at 09:43 AM. Reason: add exsample

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: JTable

    Also at www.javaprogrammingforums.com and codecall.net

    @OP: If you are going to start a discussion at multiple places, please let everyone know that. Post links. So that others can know what else is being said.

    Also bear in mind that many people won't respond to questions that are posed this way for fear of wasting their time on something that could have been answered elsewhere.

Similar Threads

  1. Jtable inside Jtable
    By anchitanc in forum AWT / Swing
    Replies: 5
    Last Post: 05-26-2012, 09:10 PM
  2. Replies: 4
    Last Post: 04-02-2012, 08:57 PM
  3. jtable
    By nr.senthilmurugan in forum NetBeans
    Replies: 1
    Last Post: 02-02-2011, 05:57 AM
  4. Adding New JTable in JTable
    By anilkumar_vist in forum New To Java
    Replies: 0
    Last Post: 01-27-2010, 09:27 AM
  5. Replies: 2
    Last Post: 05-15-2008, 11:15 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
  •