Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Weird number been put to DB table through JDBC

 
Mike Brent
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just try to put a record to the following to DB table:
Table layout:
PO_SHIPMENTS (PO_ID NUMBER (15) NOT NULL,
PO_REVISION_ID NUMBER (15) NOT NULL,
SHIPMENT_NUM NUMBER (10) NOT NULL);


Once code been executed, here is what I see in the DB table:
po_id ---> 1
PO_REVISION_ID ---> 10
SHIPMENT_NUM ----> 3.3E-27

Then I execute the code second time, here is what I see:
po_id ---> 1
PO_REVISION_ID ---> 10
SHIPMENT_NUM ----> 4.5E15

The environment we use is:
Tomcat 5
JDK 1.5
Oracle 8i
JDBC 1.4

Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"aero Xchange",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by aero Xchange:
...

String insertSql =
"INSERT INTO POLC_PO_SHIPMENTS ( PO_ID, PO_REVISION_ID,SHIPMENT_NUM)";

...


are you sure this is right? shouldn't it be something like

"INSERT INTO POLC_PO_SHIPMENTS ( PO_ID, PO_REVISION_ID,SHIPMENT_NUM) values (?,?,?)";
 
Mike Brent
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is caused by the JDBC driver 1.4
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic