Re: Jaw drop: JDBC will let you update rows with the wrong data type (within reason)

David Gibbs via JAVA400-L <[email protected]> Wed, 6 Oct 2021 15:17:50 -0500
Newsgroups gmane.comp.lang.as400.java
Message-ID <[email protected]>
On 10/6/21 2:57 PM, David Gibbs wrote:
>    stmt.setObject(1, "2");
>    stmt.setObject(2, 3);
>    stmt.executeUpdate();

Furthermore, if you do ...

stmt.setString(1, "2");
stmt.setInt(2, 3);

and execute the update, it will work fine.

david

-- 
I'm riding in the American Diabetes Association's Tour de Cure to raise 
money for diabetes research, education, advocacy, and awareness.  You 
can make a tax-deductible donation to my ride by visiting 
https://mideml.diabetessucks.net.

You can see where my donations come from by visiting my interactive 
donation map ... https://mideml.diabetessucks.net/map (it's a geeky thing).
-- 
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/java400-l.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com