That's what I'm doing now, and it works fine, thanks. I was just
wondering if there was a better way.
jason
From: Sundar Sankar [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2008 7:03 PM
To: user-java@iba
Essentially, the RowHandler is an interface with one method that
provides just one row at a time as a Map or Bean - what you do with it
at that point is up to you.
If you want to crank out xml, you can do that, but I'm not sure what
you mean by "How can rowhandler help me to look into columns?" -
Thank you all again for your suggestions.
One of the use cases of mine is to create an XML in the end. I don't have an
object serve as a middle stage to use with Rowhandler (in RowHandler's term, I
need to map the valueObject to something, right?). I also did read some post
posted by someone
Jason,
This is what you will have to do,
1. Map an object to the columns being returned from the cursor in your
sq-map-config file. i.e you should have an entry like this
2. You would have mapped your input Parameter in a map and passed it to
getSQLMapClientTemplate.queryForList("Proc
queryForList only works for things that return result sets. Oracle ref
cursors are a "sort of" result set, but the ref cursor is a *parameter* to a
callable statement, rather than being *returned from* the stored proc. This
is an important difference.
Because of this, iBATIS (and JDBC) sees them
One problem I had in this scenario is when I pass parameters to the
function, and expect a cursor back. I had to map the returning
parameter, since I had mapped all the in parameters. This prevented me
from using queryForList() as I wanted to. Am I doing anything wrong, or
does passing parameters t
Jesse,
I don't think the query for list makes much of an impact in
calling stored procedures. U will have to do a
inputMap.get("resultParameter) to get the output. The surprising thing
is the map is loaded, if you call queryForList or update or any of the
methods. I really dont think you
Ryan I guess you didn't read my original post. I tried both the Hashmap
method of queryForList and the way you suggested. The only way I can
actually get a populated List back is using the HashMap. If I do it this
way :
return
getSqlMapClientTemplate().queryForList("TEST_TESTPROC.GET_CDDRPT");
For reference:
http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+call+a+stored+procedure
Under: What SqlMapClient Method Should I Use?
...
If your procedure returns a result set (not a result set in an OUT
parameter, but a result set from the procedure itself), then use *
que
In the one you had, you were creating an empty HashMap, executing the
queryForList method passing in the empty HashMap, and then converting the
still empty HashMap to a list and returning that to your method.
queryForList doesn't take an object parameter to store the results in, it
takes an object
Ryan that's exactly what I did that wouldn't work. It returns to me a
List that has 10 elements all which are NULL.
Jesse
Try:
*public* List selectCDDRpt()
{
return getSqlMapClientTemplate().queryForList("TEST_TESTPROC.GET_CDDRPT");
}
You're returning a list of rows, no extra work is required. Use the Hashmap
if you need to pass values INTO the stored procedure.
-Ryan
On Mon, Mar 10, 2008 at 1:43 PM, Jesse Rei
I've successfully been able to use iBATIS to retrieve and map data from
an Oracle ref cursor using the examples posted on the Wiki. I do have a
questions about queryForList(string) method.
I can retrieve my List successfully if my dao code looks like this:
public List selectCDDRpt()
Trying to set fetchSize on calls to stored procedure in the SQL mapping file
-
{call pkg.get_data(?,?,?,?,?, ?,?,?,?,?, ?,?)}
But does not seem to affect. Smaller result set like 10 rows has better
performance than larger result set like say 95 rows. This is
Jeff,
You're absolutely right I looked at a table view instead of a table, hence ...
Thanks.
> Abator generates fields first, then getters/setters for each field. The
> order of members is the order in which the columns are returned from the
> JDBC driver (should be based on the ordinal positio
Abator generates fields first, then getters/setters for each field. The
order of members is the order in which the columns are returned from the
JDBC driver (should be based on the ordinal position of the column in the
table unless there's a bug in your JDBC driver).
This could be overridden by p
Hi Chris,
indeed one '?' was missing. But adding another one didnt't change the
error. If i add two, i get the excpected error PLS-00306 for the wrong
number of arguments.
Supplying even less ? Arguments results in shifting the defect column
index message:
...
--- Check the parameter mapping for
I only counted 60 "?" in your sql. Are you missing one?
-Original Message-
From: Jens Borrack [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2008 11:29 AM
To: user-java@ibatis.apache.org
Subject: "invalid row index" parameter registration Problem
Problem:
The "invalid row index" Prob
Problem:
The "invalid row index" Problem occurs, when i try to execute a stored
procedure on Oracle 10.2.0.1.0. This particular procedure has 60 in and 1 out
parameters. The interesting point is, that a similar procedure with only 13/1
in/out parameters works fine. So maybe there is any limit fo
The order of the generated members are not in exact table order.
I can't make out a logical explanation of this behaviour.
This would be handy for me in my WDSC or Rational Development Studio.
How can I accomplish this ?
I just stop and restart WebSphere... Now it is working... ;-P
-Original Message-
From: Angso, Tony
Sent: Monday, March 10, 2008 9:45 AM
To: 'user-java@ibatis.apache.org'
Subject: RE: Need Help in iBatis Configuration
When using the SQLMap and Java code below, am getting an empty resul
When using the SQLMap and Java code below, am getting an empty result,
(I mean not null). The parameter values are correct and when queried
directly, it return 1 row. However doing it through iBatis, return an
empty but initialized rxBean...
Any help is much appreciated.
My SQLMap is
Depending on your iBATIS version, I think you can get to what you
want, but it is pretty fragile, because you have to do some casting to
internal classes which could change.
I think your safest bet is the RowHandler or a stored procedure - and
I say stored procedure only because it sounds like you
The iterate tag would do that (read the list and put it in your where
clause).
-Original Message-
From: ashishvk [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2008 8:19 AM
To: user-java@ibatis.apache.org
Subject: help in executing a query
which is the best way of executing the foll
24 matches
Mail list logo