Aptitude (12) ASP.NET (2) Automata (4) Browser (1) C (5) C# (1) C++ (10) Code (3) CSS (1) Data Structure (1) DATABASE (3) HTML (1) java (43) JSP (1) math (1) MySql (8) other (6) php (3) Servlet (3)

Tuesday, 31 January 2012

Connection to Mysql Database and Run servlet action with database


2.extract this jar file wheather with the help of  command prompt or with the help of  RAR zip extractor.
3.After extracting mysql connector jar file,we will find three folder
·         Com
·         META-INF
·         org
 5.Copy com  folder .
6. Paste above copied folder into the classes folder of your project’s WEB-INF folder.
7. Now  we are  connected with Mysql database.
8.write your servlet program importing sql package.
Include in this program points  given below  or make then import a package of  confgiration of points given below  then import:
a.  use of class.forName() method
b. use of getConnection() of the DriverManager class.
c.use of createStatement,excuteUpdate,etc….
9.compile your  servlet program.
10.copy the classes  files.
11.paste those  into the classes folder of project’s WEB-INF folder .
12.make web.xml file
13.run tomcat.
14.enter your URL as localhost:potnumberas 8080/application folder name/url of main servlet file which is included in web.xml file of project
e.g.    http://localhost:8080/di/DataInsertion
15.Process completed


No comments:

Post a Comment