|
From: <jue...@we...> - 2004-03-30 16:14:01
|
Actually, passing in JdbcTemplate would be good enough, as it contains = its DataSource. JdbcDaoSupport is also implemented that way: You can = either pass in a DataSource *or* a JdbcTemplate. I'm still for leaving the example as-is, though: passing in a DataSource = is more natural, particularly for beginners, as JdbcTemplate remains an = implementation detail then that's not even visible in configuration. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Colin Sampaleanu Sent: Tuesday, March 30, 2004 6:00 PM To: spr...@li... Subject: Re: [Springframework-developer] SQLErrorCodesFactory Product Name lookup I think we should make the proposed change, then people can use=20 JdbcTemplate either way. As for the samples, at that point, I personally = think they can be left the same; pre-instantiating the template is no=20 longer a preferred solution. It may in fact be less desireable since=20 people have to pass in both a DataSource and JdbcTemplate to beans that=20 need it, instead of just a DataSource. tho...@tr... wrote: >I noticed this while preparing for my JDBC presentation. All our = samples >preconfigure a DAO with a DataSource. Would it make sense to switch = that to a >preconfigured JdbcTemplate if that is the preferred way to work, or = should we >just make this proposed change and leave it at that? > >I made the change locally, but it broke a bunch of tests where the mock = objects >expected some calls for the meta data. I'll try to clean that up and = check >things in by tomorrow some time. > >Thomas > > >Quoting rod...@in...: > > =20 > >>>Well one solution of course (as mentioned at the time I=20 >>> =20 >>> >>brought this up)=20 >>was to just use a premade JdbcTemplate which comes from the=20 >>context,=20 >>since it is of threadsafe. >> >>That's what I've always done, so I've never been bothered by=20 >>the lookups. >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by: IBM Linux Tutorials >>Free Linux tutorial presented by Daniel Robbins, President and CEO of >>GenToo technologies. Learn everything from fundamentals to system >>administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dc= lick >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> =20 >> > > > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcl= ick >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > =20 > ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |