• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet With Spring Or (JDBC and JNDI)?..  RSS feed

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends..

I just curious how to good implementation for Servlet (especially for DAO layer)..
As far as i know that Servlet ussually implemented by using EJB for DAO..
if i just uses Tomcat as my Servlet Container.. so what is good implementation for DAO layer?..
Do i have to use JNDI which implemented in a Class which implementating static Method for obtain the connection?
And another Class (DAO class) accesses that Class for get Connection then do some operations..

Or do i have to use SpringJDBCTemplate which refferenced by JNDI dataSource?..
but as far as i know that i can't inject Spring bean directly... by @Autowired annotation..
it is mean that i have to configure all of my DAOs in my applicationContext.xml..

Please give me any suggestions..

Thanks in advance..
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How you want to design the data access layer is entirely up to you. You can use plain JDBC or hibernate or Spring DAO support or Entity EJB or some other framework that supports JPA, the list goes on. Whichever suits your application the best will do.

Oh and EJBs require a J2EE container as opposed to a web container
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!