You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by mr...@gmx.de on 2003/03/06 11:06:39 UTC

[DBUtils] efficient use of resultsetwrapper

Hy all,

I have a little problem with using the ResultSetWrappers.
I dont know at the moment how to use them efficient.

If I get a resultSet, I store it in new object which can be an ObjectArray
or a Collection and the result set is closed as fast as possible. This is done
in the database layer. This new object is then passed to the business layer
because I dont want to pass the original resultset.

If I now wrap the resultset in this process in a SQLNullCheckedResultSet or
a formatMYResultSet or somewhat else, I cannot use it in an efficient way,
because I use either only the getObject() or the getString() methods of the
result set. I think it costs to much performance to use a big switch statement
to process all sql.Types in every row of the result set.

So I think it would be better to use a kind of formatter at the time of
instantiating the business objects.
The advantage would be, that at this point it is clear to which object every
resultset field has to be cast and the expensive big switch statement is not
needed.

I am really thankful for all answer

Michael

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!