aspose file tools*
The moose likes JDBC and the fly likes Weird number been put to DB  table through JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Weird number been put to DB  table through JDBC" Watch "Weird number been put to DB  table through JDBC" New topic
Author

Weird number been put to DB table through JDBC

Mike Brent
Greenhorn

Joined: Sep 22, 2005
Posts: 2
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

Joined: Jan 10, 2002
Posts: 60082
    
  65

"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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

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

Joined: Sep 22, 2005
Posts: 2
The problem is caused by the JDBC driver 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Weird number been put to DB table through JDBC
 
Similar Threads
What Would Cause A Method That Inserts Records To Throw An Exception?
insert into method
Any Possibilities to get other than SQLException while using executeUpdate() method
Auto Increment ID Field Table in the Oracle Database
Java - Mysql connectivity