Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JDBC and Relational Databases and the fly likes resultsetmetadata Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "resultsetmetadata" Watch "resultsetmetadata" New topic


Alka ravi

Joined: Sep 04, 2012
Posts: 7

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

Joined: Jun 19, 2010
Posts: 825

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.

The quieter you are, the more you are able to hear.
Alka ravi

Joined: Sep 04, 2012
Posts: 7

this is best way to read the file?
Rob Spoor

Joined: Oct 27, 2005
Posts: 20136

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.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: resultsetmetadata
It's not a secret anymore!