The Artima Developer Community
Sponsored Link

Java Answers Forum
How to handle Microsoft Access data type: CURRENCY , DATE/TIME in java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
john

Posts: 10
Nickname: swing
Registered: Jul, 2002

How to handle Microsoft Access data type: CURRENCY , DATE/TIME in java Posted: Jul 15, 2002 6:36 PM
Reply to this message Reply
Advertisement
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.


Help please.

Really Appreciate !!!!!!!!

Topic: Why is the variable intializer incomplete??? Previous Topic   Next Topic Topic: Removing GUI Compenents

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use