• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How To Connect JSP with MySQL

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have created some jsp files without database its working perfectly, now i want to connect that project with data base with Mysql.


I don't have any idea about MySql, I tried from out side but till now i didn't get any idea about connection.


Please any one help me from where i want to download mysql , how i want to install and how to connect with jsp page, because iam new to developing field no one is not there to guide me in my office.

Please explain with simple addition program code for connection, then i will develop my self.


Thanks in advance.

Thank & Regards,
Jenifer Rajkumar.
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Create a java class that manages your database related things, for e.g. making connection, retrieving result set etc. Under META-INF folder create a file called context.xml where you define your database connection settings.
From your jsp, use JSTL/EL to retrieve results and other things.
 
P Arunkumar
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I can't understand how to connect my jsp page with my sql please guide with step by step process.


Thanks in advance,
Jenifer Rajkumar.
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I said create a java class that manages your connection, that can be somewhat like this



create a file context.xml and store it under META-INF


a sample jsp code to retrieve data




And don't forget to include the required library files in your project build path.
 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic