• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DB issue (prepared statement)

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am using TYPE_SCROLL_SENSITIVE and CONCUR_READ_ONLY to iterate through the result set object in both directions.

statement = connection.prepareStatement(query, rs.TYPE_SCROLL_SENSITIVE,rs.CONCUR_READ_ONLY);
Query: SELECT DISTINCT POL_NO, P_CODE, P_LN, MAX(EFF_DT) AS EFF_DT, T_TYP, PER_FROM,
PER_TO, BUS_TYP FROM DMGT.ARC WHERE BUS_TYP IN ('C', 'P') AND POL_NO = ?
AND (ERR_IND ! = 'X' OR ERR_IND IS NULL) GROUP BY T_TYP, PER_FROM, PER_TO,
POL_NO, P_LN, P_CODE, BUS_TYP ORDER BY EFF_DT DESC

I am able to get the data from data base DB2 in local (Windows box) but Iam faccing problem mentioned below in DEV (unix box).
Note: Both enviroments(local and dev) using same database(DB2 version 9.1) and different websphere application servers (but versions are same v6.1).we are getting the connection from the connection pooling .

Please suggest me on this and also advance thanks to all.

Error: SENSITIVE CURSOR SQL_CURLN300C1 CANNOT BE DEFINED FOR THE SPECIFIED SELECT STATEMENT

Thanks,
Sreehari.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not experienced with DB2, but from this explanation of the error message I guess that the DEV database is obtaining the data through a different plan (storing the results in a temp table) for some reason.

Check for any difference between the two databases. I don't know how this is in DB2, but in Oracle a query plan might change for a large number of reasons:

- different indexes,
- different amount of data in table,
- different clustering factor of indexes,
- different collection of statistics (or lack of thereof),
- different system parameters,
- different architecture.

I may be mistaken; it is also possible that DB2 won't switch query plans so readily. But if it does, the feature you use (sensitive resultset) is very fragile and might stop working even after some innocuous change.
 
Sreeharinaidu Yendluri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your help.

I got solution i.e. TYPE_SCROLL_INSENSITIVE
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic