• Post Reply Bookmark Topic Watch Topic
  • New Topic

creating objects  RSS feed

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey there, i have the following objective:
To search through an excel sheet, view the Field values for each line, and create objects based on their field value.
i can connect and call queries successfully from the excel file, and have the following issue:
the excel file is something like
SHOW NAME SHOW NUMBER STATE ...
IBM 509 NSW
now, what i thought of doing is going through each line of the excel file, and assigning Object Show the following values:
Show.addName(rs.getString( "SHOWNAME" ))
Show.addNumber(rs.getSring("No"))
etc.. (please note the above code is for example only.)
what i have done is tried to return these values using the system.out command, ranther than jump straight into object creation, and the following works and compiles, but throws:
"java.sql.SQLException: [Microsoft][ODBC Excel Driver] Numeric field overflow"


then i could replace the system.out calls to be instructions to add to my object. My sql is not very strong, and i was wondering what the best approach would be to achieve what i am hoping. I am aware that the scalability of this is rather large, as i am pre-loading a whole file into my applicatoin, however for the purpose of the application's gui and functionality, it is the best approach.
Thanks for your time, all suggetions and code appreciated
-twans
------
SCJP
 
Antoine Waugh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to be more specific, here is another working example of what i am trying to achieve. Is this method appropriate for reading in databases, and will it be possible with the use of an applet?

thanks in advance
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!