Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in fetching data from database

 
suresh gonuguntla
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In database it is showing the value of the 3rd column is in decimal form (i.e. 123.45)

String getInfo = "{CALL PKG_TICKET.IF_TINFO" + "(?, ?, ?)}";
gcs_getInfo = (OracleCallableStatement)go_dbConn.prepareCall(getInfo);
System.out.println("The amount in the Database:"+gcs_getInfo.getString(3));

But after executing this code, I got 123,45 in my log file, while it's value is 123.45 in DB.

Is there any problem in code or any conversion problem in database or what???

Plz provide the solution as quick as possible
 
Scott Selikoff
author
Saloon Keeper
Posts: 4009
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using getLong() or getDouble() instead of getString(). Then you can use a java number formatter to display the number properly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic