File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes How To Connect JSP with MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JDBC
Reply Bookmark "How To Connect JSP with MySQL" Watch "How To Connect JSP with MySQL" New topic
Author

How To Connect JSP with MySQL

P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 87
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.
Swastik Dey
Ranch Hand

Joined: Jan 08, 2009
Posts: 990

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.


Swastik
P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 87
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
Ranch Hand

Joined: Jan 08, 2009
Posts: 990

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.
 
 
subject: How To Connect JSP with MySQL
 
Threads others viewed
How to use different hibernate configurations
MySql Connection
JSP -> MySQL -> MS Access
connect my MySQl databse
for the jdbc connectivity....
developer file tools