File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Query from View using iBatis Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Query from View using iBatis" Watch "Query from View using iBatis" New topic

Query from View using iBatis

Sam Gehouse
Ranch Hand

Joined: Jul 21, 2003
Posts: 281
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

Joined: Jul 21, 2003
Posts: 281
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.
I agree. Here's the link:
subject: Query from View using iBatis
It's not a secret anymore!