I am trying to extract data(Access database) from a query, but I don't know how to handle Access data type: "currency" and "date"
Here is codes for function getNextRow
public Vector getNextRow(ResultSet rs, ResultSetMetaData rsmd) throws SQLException { Vector currentRow = new Vector(); for ( int i=1; i<= rsmd.getColumnCount(); i++ ) switch(rsmd.getColumnType(i)){ case Types.VARCHAR: case Types.LONGVARCHAR: currentRow.addElement(rs.getStrin(i) ); break; case Types.INTEGER: currentRow.addElement(new Long(rs.getLong(i))); break; case Types.DATE: currentRow.addElement(rs.getDate(i)); break; Default: //currency, I don't know how to do
} return currentRow; }
The code case Types.DATE does not work! it can't catch the data type Date/Time from Access.