JdbcTemplate

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

JdbcTemplate

#1

Post by pauldev »

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: 101
Joined: Mon Mar 29, 2010 3:11 pm
Location: Utah, USA

Re: JdbcTemplate

#2

Post by YoungstromMJ »

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

#3

Post by pauldev »

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: 101
Joined: Mon Mar 29, 2010 3:11 pm
Location: Utah, USA

Re: JdbcTemplate

#4

Post by YoungstromMJ »

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

Return to “Java Web Project Support (Stack)”