Note that there are some explanatory texts on larger screens.

plurals
  1. POWeird DB2 database issue : Websphere Connection Pooling
    primarykey
    data
    text
    <p>I am running a query from my java based web app running in a Websphere container. This query however, being pretty simple, fails with a weird erorr as follows: </p> <pre><code>[5/15/09 16:50:33:828 IST] 0000001e SystemErr R com.ibm.db2.jcc.b.zd: Invalid data conversion:Requested conversion would result in a loss of precision of 40000 [5/15/09 16:50:33:828 IST] 0000001e SystemErr R at com.ibm.db2.jcc.b.q.a(q.java:137) [5/15/09 16:50:33:828 IST] 0000001e SystemErr R at com.ibm.db2.jcc.b.q.a(q.java:1189) [5/15/09 16:50:33:828 IST] 0000001e SystemErr R at com.ibm.db2.jcc.b.ad.a(ad.java:1217) [5/15/09 16:50:33:828 IST] 0000001e SystemErr R at com.ibm.db2.jcc.b.ad.kb(ad.java:2977) [5/15/09 16:50:33:828 IST] 0000001e SystemErr R at com.ibm.db2.jcc.b.ad.d(ad.java:1970) [5/15/09 16:50:33:828 IST] 0000001e SystemErr R at com.ibm.db2.jcc.b.ad.d(ad.java:2342) [5/15/09 16:50:33:828 IST] 0000001e SystemErr R at com.ibm.db2.jcc.b.ad.U(ad.java:489) [5/15/09 16:50:33:828 IST] 0000001e SystemErr R at com.ibm.db2.jcc.b.ad.executeQuery(ad.java:472) [5/15/09 16:50:33:828 IST] 0000001e SystemErr R at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeQuery(WSJdbcPreparedStatement.java:559) </code></pre> <p>The query is pretty simple : it is as simple as </p> <pre><code>select field1, field2 from &lt;xyz table&gt; where &lt;xyz_pk&gt; = ? </code></pre> <p>The primary key is a INTEGER(4) and has data that has values up to 99999999. But however, when I run this query is run in my web app on a connection obtained from websphere connection pool, it starts failing for pk values > 35k+. In the jdbc binding code, I tried doing a preparedStatement.setInt() and preparedStatement.setFloat(). But nothing seems to work!! It just works for anything below 35k+ and fails for everything above that. </p> <p>Java's int size is much bigger than 35k+, so why would this query fail with this error? This happens just from my application, when I try the same query with a database client of my choice, proper results are being obtained for all values of the pkey! </p> <p>Did anyone faced this issue before? If yes, how did you get around it? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload