• 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

Query from View using iBatis

 
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using iBatis (2.5) with DB2 version 8.x and Spring 2.5. Is there any issue in querying a view (as opposed to table)? It is a very simple select as:




org.impl.CodeBean is a simple POJO with String attributes only with public getter and setter. StringTrimTypeHandler are custom code written.

My SQL are working when I am using table, as opposed to View.

When I call the above findAll from JUnit for View, I get exception as:



I must be missing something.

Query from View is supported in iBatis, correct?
 
Sam Gehouse
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The view exists in DB2 for that schema. I can successfully run the generated SQL (that is generated by iBatuis by querying the View) in DB2 and get correct result.

While there is no table with the name V_MY_VIEW, there is view with the name V_MY_VIEW. The error code 42704 is thrown if table is not found. But the goal here is to run against the View and not the table.

I am not clear why 42704 error is thrown while I was primarily querying the view.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic