JSP connect MySQL
To connect MySQL with Java Server Page(JSP). Some steps should be followed:
Step 1: Download MySQL JDBC connector driver from the Internet. URL: http://dev.mysql.com/downloads/connector/j/
Step 2: Put the jar file downloaded in Step 1 in the Tomcat common lib folder and add this jar file to the CLASSPATH so that the JSP page can find the specified class.
Step 3: Create the JSP page with MySQL connection : Example is shown below:
Hope this will help you in your JSP development. One notice is that the driver string can also be "org.gjt.mm.mysql.Driver". This is to make it backward compatible with previous
vsersion of MySQL.
A : "I have written over 100,000 lines of code in primary school" B : "Oh. So cool. Then what's after?" A : "Then I learnt how to write loop statements"