Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

resultsetmetadata

 
Alka ravi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Is above conversion INTEGER to DOUBLE is correct. if i use Interger.ParseInt() for INTEGER sql type and database has Interger field then it throws error for INTEGER like 11.0
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't really understand well what you are asking...
If you are talking about the first case, I don't see the point of setting double in a column that contains integer value.
Also, value 11.0 cannot be parsed to int, since it's not integer value.
 
Alka ravi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this is best way to read the file?
 
Rob Spoor
Sheriff
Posts: 20827
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see a few problems with that code (apart from not being in code tags).

1) You use a Vector. You should declare it as a List and use ArrayList as the implementing class.
2) You should use generics.
3) You should definitely close the FileInputStream when you're done with it, in a finally block.

Other than that I find it odd that you take all cells and put them in one long Vector. You lose all information about which cell belongs to which row that way.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!