• Post Reply Bookmark Topic Watch Topic
  • New Topic

Good approach to perfrom a insert operation with

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using AJAX from my JSP to perfrom a insert operation , the data is submitted to the servlet which in turn contacts the session bean and performs a insert operation ?


Is this a good approach ?

Or should i directly perform an insert operation from my servlet ??
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

If you don't use this bean data again and you get success to insert data direly then i think you have to use direct insert to tha database.

But at last choice is your......

 
Mohamed Inayath
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In first place why are you using Session Bean.

If you want to make use of the services provided by the container(depends upon your requirement) then you can have Bean in place.

Otherwise you can use a simple Data Acces Object(DAO) in place of Session Bean.

Also its not a good practice to have data operations within servelts.
Keep it Separate and Simple.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!