swing - java.lang.ArrayIndexOutOfBoundsException: 0 >= 0 -
here complete code:
stat = con.preparestatement("select exceltable.payorbankroutno, exceltable.amount, exceltable.accountno, exceltable.serialno, exceltable.presentingbankroutno, exceltable.presentmentdate exceltable exceltable.creationdate = ? inner join (select payorbankroutno, amount, accountno, serialno exceltable group payorbankroutno, amount, accountno, serialno having (count(payorbankroutno) > 1) , (count(amount) > 1) , (count(accountno) > 1) , (count(serialno) > 1)) dup on exceltable.payorbankroutno = dup.payorbankroutno , exceltable.amount = dup.amount , exceltable.accountno = dup.accountno , exceltable.serialno = dup.serialno order exceltable.serialno"); stat.setstring(1, datename); rs = stat.executequery(); metadata = rs.getmetadata(); li_cols = metadata.getcolumncount(); allrows = new vector(); while(rs.next()) { vector newrow = new vector(); for(int i=1; i<= li_cols; i++) { newrow.addelement(rs.getobject(i)); } allrows.addelement(newrow); }firetablestructurechanged(); } catch(exception e) { e.printstacktrace(); system.err.println("error "+e); } } public int getcolumncount() { return li_cols; } public int getrowcount() { return allrows.size(); } public object getvalueat(int arow, int acol) { row = (vector)allrows.elementat(arow); return row.elementat(acol); } public class getcolumnclass(int col) { return getvalueat(0, col).getclass(); } public boolean iscelleditable(int row, int col) { return false; } public string getcolumnname(int acol) { return columnnames[acol]; } string[] columnnames = {"payorbankroutno", "amount", "accountno", "serialno", "presentingbankroutno", "presentmentdate"}; }
your question can't possibly answered. have no idea error occurs or tablemodle looks like.
why creating custom tablemodel? guess problem because implemented model incorrectly.
see table database example
code found in table database simple example shows how use defaulttablemodel.
Comments
Post a Comment