|
From: <jue...@we...> - 2004-02-28 22:11:39
|
But the javax.sql.DataSource interface is plain JDBC, typically to be = used by Spring DAOs just like any other DataSource. It's getConnection = methods throw SQLException, according to the DataSource interface. =20 This is about *setting up* a DriverManagerDataSource; I don't see why = setDriverClassName or the constructor should throw a DataAccessException = here. Other Spring beans - including DAO support classes - throw = IllegalArgumentException or the like too when they get bad configuration = parameters on initialization. =20 As I said, I changed DriverManagerDataSource initialization to throw = IllegalArgumentException, after Thomas' remark. The kind of unchecked = exception thrown on initialization is a rather academic issue... In = particular, if the driver class name isn't right, you can't do anything = meaningful anyway. =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Rod Johnson Gesendet: Sa 28.02.2004 22:33 An: spr...@li... Betreff: Re: [Springframework-developer] DataFieldMaxValueIncrementer >Good point - changed to IllegalArgumentException. >I just didn't want to throw CannotGetJdbcConnectionException like = before; it arguably wasn't appropriate. In general. the DataSource = implementations shouldn't use DataAccessExceptions in the first place. I disagree. I think that the user should be able to catch DataAccessException confidently in all cases (which was why I changed = from ClassNotFoundException to a DataAccessException). I don't have terribly strong views on this as it's not a production = usage class anyway--but that also implies it wasn't really worth changing the behaviour either... ------------------------------------------------------- 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=3D1356&alloc_id=3D3438&op=3Dclick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |