- Make a lib names folder inside WEB-INF folder of your project.
- Go to Download This MySQL connector .JAR file and download it.
- Place the above downloaded jar file inside the lib folder which is created in step 1.
- now place your servlet's classes file into classes folder.
- place web.xml file of your project into WEB-INF folder.
- Run tomcate and enter your project's running URL.
- Process completed.
Aptitude
(12)
C
(2)
C++
(10)
CSS
(1)
Data Structure
(2)
English
(6)
Fitness
(2)
General
(14)
HTML
(3)
Integration
(1)
Itinerary and Travel Cost
(2)
Java
(29)
JQ
(5)
JS
(5)
JSP
(1)
Lightning
(14)
logical
(3)
Lyrics
(1)
Math
(1)
Music Notation
(20)
MySql
(4)
Network
(1)
Regex
(1)
salesforce
(131)
Servlet
(4)
SF Admin
(31)
SF Dev
(102)
Spiritual Content
(3)
SQL
(4)
SQL_SERVER
(1)
StudyPoints
(2)
Trips
(1)
ytChannels
(2)
अन्ताक्षरी
(4)
A very simple way for connecting MySQL
Connection to Mysql Database and Run servlet action with database
1.Got to Download path of mysql connector .jar (Dot JAR ) file and download it.
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
Tweet
Subscribe to:
Posts (Atom)