User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 402,006 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,405 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 11349 | Replies: 33 | Solved
Reply
Join Date: May 2008
Posts: 6
Reputation: ashish1234 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
ashish1234 ashish1234 is offline Offline
Newbie Poster

Re: How to Connect MySQL from JSP Page

  #31  
May 29th, 2008
Can u plz tell me wats wrong in using jsp to connect to a databse..
Reply With Quote  
Join Date: Jan 2008
Posts: 35
Reputation: electron33 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 4
electron33 electron33 is offline Offline
Light Poster

Re: How to Connect MySQL from JSP Page

  #32  
May 29th, 2008
There is nothing wrong by putting the database connection in the JSP, but you have to create a new database connection and query for every page you creates. This will reduse the performance and response on server. This is one of the problems. Instead you could create a connection class and put it into application scope and the connection will be made when server is started. This is done only once. Then it is available for all objects that uses table info from the database.
Last edited by electron33 : May 29th, 2008 at 7:28 pm.
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,222
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 10
Solved Threads: 270
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: How to Connect MySQL from JSP Page

  #33  
May 29th, 2008
Originally Posted by electron33 View Post
There is nothing wrong by putting the database connection in the JSP

Ever heard of MVC (Model-View-Controller)? Well then you may want to google out something on the subject and learn new things
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Jan 2008
Posts: 35
Reputation: electron33 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 4
electron33 electron33 is offline Offline
Light Poster

Re: How to Connect MySQL from JSP Page

  #34  
May 30th, 2008
MVC (Model View Controller) That is Model this part holds the data between view and database or files, View this is the JSP, GUI or other interface presentet to the user, Controller this is the part that sends the messages of what to do with the data when user clicks a component or some changes happens on the database table. Please read more about this topic at SUN's pages.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 9:33 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC