|
From: Rod J. <rod...@in...> - 2004-02-16 20:34:02
|
Thomas,
Sounds great. With this there I'd be glad to get rid of JdbcHelper.
Not sure about (3). I think this needs further thought. For 1.1 we could add
a true disconnected result set: not RowSet as it throws SQLException, which
we want to get away from.
Also a convenience method returning int would be handy, for counts and the
like. Please can I have this, despite Juergen's dislike of convenience
methods :-)
Regards,
Rod
----- Original Message -----
From: <tri...@tr...>
To: <spr...@li...>
Sent: Monday, February 16, 2004 5:26 PM
Subject: RE: [Springframework-developer] JdbcHelper
> I can see the need to go beyond a single row/value type query.
>
> How about a new method for the JdbcTemplate:
>
> Object runSqlStatement(String)
>
> Based on the type of SQL passed in it would return:
>
> 1) An Integer containing the number of rows affected if it is an update
statement
>
> runSqlStatement("update emp set salary = salary * 1.5") would return an
Integer
> with the update count
>
> 2) A single Object (Integer/Long/String) based on the value returned from
a
> single value/single row query
>
> runSqlStatement("select last_name frmo emp where id = 2") would return a
String
> containing the last name
>
> 3) An ArrayList of ArrayLists containing a list of rows with a list of
column
> values returned by the query
>
> runSqlStatement("selecy id, last_name from emp") would return an ArrayList
> containing an ArrayList for each row. The second list would contain an
Integer
> with the id and a String with the last_name.
>
>
> Number 3 might be a stretch, but we would still have to check for this,
since we
> have no control over the SQL coming in.
>
> Thomas
>
>
> Quoting rod...@in...:
>
> > I've actually just (yesterday) introduced into into a whole
> > bunch of test cases at a client. Maybe we could put an
> > improved runSQLFunction() method on JdbcTemplate? This is a
> > very convenient one-liner, and basically the only reason I
> > use JdbcTemplate.
> >
> > Regards,
> > Rod
> >
> >
> > -------------------------------------------------------
> > SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> > Build and deploy apps & Web services for Linux with
> > a free DVD software kit from IBM. Click Now!
> > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
>
>
>
>
>
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
|