Jump to content




Recent Topics

Recent Status Updates

  • Photo
      18 Aug
    KodeKool

    When faced with a wall of errors and no hope to fix them, remember the following "Programs always do what you tell them to, and seldom what you want them to, but eventually you'll run out of things that can go wrong and it'll just work. and that's the secret to good programming."

    Show comments (2)
View All Updates

Developed by Kemal Taskin
Photo
- - - - -

JTable


  • Please log in to reply
No replies to this topic

#1 skuskusas

skuskusas

    CC Lurker

  • New Member
  • Pip
  • 4 posts
  • Programming Language:C++
  • Learning:C++

Posted 04 September 2012 - 10:01 PM

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

now table is table a me need a a+1 a3 a4 ....
1 1 2 3 4 .....
2
3
4


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);
				
			 }
		 }

  • 0