On Sun, 24 Nov 2002, Juozas Baliuka wrote:
>
>
> I need some simple utils for JDBC (o/r mappings do not solve all of my
> problems).
> I use callbacks at this time, it is good for performance and no problems
> with "cose":
>
> //connection is "ThreadLocal"
> db.executeQuery(
> "SELECT * FROM Boing b WHERE b.name=?",
> new Object[] { name },
> new Handler(){
> public void handle(ResutSet rs )throws SQLException{
> //my
> code........................................................................
> ....................
> }
>
> }
>
> );
> It is possible to have predefined handlers to convert result sets to data
> structure like List, if max resultset size is known.
> It can be used to implement something like this :
>
> int count = db.executeIntQuery( "SELECT count(*) FROM Boing b WHERE
> b.name=?", new Object[] { name });
>
>
> I think this stuff can be usefull for JDBC developers.
I agree. Some legacy code at my company has the same concepts but is then
implemented irritatingly [all the handlers are anonymous inner classes of
one huge file].
Are you able to submit/commit your Handler system?
Hen
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>