I'm facing a problem here while trying to get the double sum of a jtable column. My table gets only 3 columns from a mySQL table. One of the columns is DATE type, and the other two are DOUBLE type. So when i try:
double xreoseistot = 0;
double xreosi;
for(int i = 0; i < jTable1.getRowCount(); i++){
xreosi = Double.parseDouble((String)jTable1.getValueAt(i, 2));
xreoseistot += xreosi;}
I get an error saying: "Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.sql.Date cannot be cast to java.lang.String"
So the question is, why my code tries to get all of the table converted to String and not just the column and also, what's the solution to this?