JdbcTemplate

Support and Announcements for the LDS Tech Java Web Application Platform (setup, configuration, bugs, feedback).
pauldev
New Member
Posts: 28
Joined: Mon Jan 07, 2013 12:42 pm

JdbcTemplate

Postby pauldev » Thu Jan 24, 2013 12:24 pm

Thanks for taking your time on answering my questions...
In the stackstarter app code generated, I am trying to figure out how/where the JdbcTemplate gets instanciated. I don't see any @component or @named annotations in the jdbcTemplate code. But I see that it is somehow injected into the ExampleServiceImpl constructor. So this seems to imply that somewhere there is a spring applicationContext.xml file somewhere that creates the JdbcTemplate bean. (I searched my .m2\repository\org\lds\stack\db\stack-db-spring\3.0.12 jar, but could not located the springbean in its xml files)
Any ideas on where it gets created so it can be injected?
(I am trying to also figure out how the jndi settings are being sent from stack-db:data-source into the datasource in the JdbcTemplate)

@Inject
public ExampleServiceImpl(JdbcTemplate jdbcTemplate, Validator validator) {

YoungstromMJ
Member
Posts: 100
Joined: Mon Mar 29, 2010 2:11 pm
Location: Utah, USA

Re: JdbcTemplate

Postby YoungstromMJ » Thu Jan 24, 2013 1:35 pm

JdbcTemplate is created in our "stack-db:data-source" namespace handler. Here are the schema docs that explain what the namespace handlers do and what beans are created by them.

http://code.lds.org/maven-sites/stack/m ... index.html

Does that help?

Mike

pauldev
New Member
Posts: 28
Joined: Mon Jan 07, 2013 12:42 pm

DAOSupport

Postby pauldev » Wed Feb 20, 2013 9:03 am

Thanks for all the info...
After doing some reading I notice that there is a DAOSupport class that appears to simplify the DAO and jdbcTemplate injecting.
I was wondering if you have any advice on whether to use or not use DAOSupport. Or if there is code in the stack-db which makes DAOSupport less desireable.

YoungstromMJ
Member
Posts: 100
Joined: Mon Mar 29, 2010 2:11 pm
Location: Utah, USA

Re: JdbcTemplate

Postby YoungstromMJ » Wed Feb 20, 2013 2:47 pm

I don't have any advice. If you want to build off of DAOSupport go ahead. We just provide the raw components.


Return to “Java Web Project Support (Stack)”

Who is online

Users browsing this forum: No registered users and 1 guest