Hi there, just use @Resource annotation to injectit.
something like: @Resource(name = "datasource") bye norman Am Montag, 29. August 2011 schrieb Pietro Romanazzi < [email protected]>: > Dear All, > with the Avalon deployment of james (2.3.2) I used the following code to get a db connection within a mailet: > ServiceManager serviceManager = (ServiceManager) > this.mailetContext.getAttribute(Constants.AVALON_COMPONENT_MANAGER); > > // Get the DataSourceSelector block > DataSourceSelector ds = (DataSourceSelector) > serviceManager.lookup(DataSourceSelector.ROLE); > DataSourceComponent dc = (DataSourceComponent) ds.select("maildb"); > conn = dc.getConnection(); > ... > ... > > Has anyone tried the same thing with Spring deployment? > Thanks and regards, > > Pietro > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
