My production Springframework code doesn’t normally need to get the datasource directly because I choose to inject the template. However, sometimes there is a need to get the datasource.
The datasource is usually defined as
<jee:jndi-lookup id="jxportalDs" jndi-name="jdbc/jxportal"/>
If you try to inject that with
@Resource(name = "jxportalDs") private DataSource dataSource;
You will get compile problems because the the code declares a type of DataSource, but there is not a type declared for Datasource. This can be fixed by adding a type to your jndi declaration
<jee:jndi-lookup id="jxportalDs" jndi-name="jdbc/jxportal" expected-type="javax.sql.DataSource"/>
sheltonn December 6th, 2011
Something like this normally works on Linux:
find . -type D -name .svn | rm -r
Not on Mac. You have to remember to add xargs
find . -type D -name .svn | xargs rm -r
Without the xargs, it is like calling rm without a target.
sheltonn December 5th, 2011