I am trying to add the databases to specific column,row the column always is the same but the row change. So I enter the variable and trying to add one to the number but not luck all is printing are 0 so is not adding any number to the variable for that reason my table stay in the same row and never change. I try i++; i=i+1; all I have is 0 on the println(). Im using Netbeans.
Statement stmt = null;
String sql="select * from gateway where date= "+id;
try{
Connect conn=new Connect();
stmt = conn.makeStatement();
rs = stmt.executeQuery(sql);
while(rs.next()) {
int i=0;
Object ids = rs.getString("Business");
Object items = rs.getString("GatewayJob");
Object descriptions = rs.getString("Status");
Object quantitys = rs.getString("Timework");
Object price = rs.getString("Notes");
jTable1.getModel().setValueAt(ids,i, 0 );
jTable1.getModel().setValueAt(items, i, 1);
jTable1.getModel().setValueAt(descriptions, i, 2);
jTable1.getModel().setValueAt(quantitys, i, 3);
jTable1.getModel().setValueAt(price, i, 4);
System.out.println(i);
i++;
}