Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problems with Integer.toString(0

807605Oct 5 2007 — edited Oct 6 2007
All,

I am converting from int to String, and place those Strings into my PreparedStatement, ? ? ? .
When I use setString(1, "String") works fine.

When I try using setString(1, Integer.toString(integer) does not work. If the integer day = 5, Integer.toString(day) produces a 9, not 5 like it should.

I see that I have to specifically enter a String for set???, but my variables are integers.
How can I convert them?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 3 2007
Added on Oct 5 2007
9 comments
525 views