Now Let us see how to connect jsp (Java Server Page) with Mysql in Linux - Ubuntu, mint, debian,. Java server page is a technology used to create dynamic web pages & server-side scripting language. It is similar to php but uses java programming language.
To run a jsp we need a web server,
1. Install tomcat server in your system :
by giving the following command in terminal
To test whether tomcat installed properly
Open your browser & type the following URL:
http://localhost:8080/
You will get the following result
Install JDBC Driver :
To make a connection between JSP & Mysql, install a JDBC(connector/J) driver .
★ Download mysql-connector-java-version-bin.zip
link to Download
★ Extract the zip and get the mysql-connector-java-5.1.13-bin.jar file
★ Copy the .jar file to the following location
filesystem/usr/share/tomcat6/lib
i.e
/usr/share/tomcat6/lib
To run a jsp we need a web server,
1. Install tomcat server in your system :
by giving the following command in terminal
You can install a new version(version-8 ) of tomcat by specifying the version number in the command.
sudo apt-get install tomcat7
To test whether tomcat installed properly
Open your browser & type the following URL:
http://localhost:8080/
You will get the following result
Install JDBC Driver :
To make a connection between JSP & Mysql, install a JDBC(connector/J) driver .
★ Download mysql-connector-java-version-bin.zip
link to Download
★ Extract the zip and get the mysql-connector-java-5.1.13-bin.jar file
★ Copy the .jar file to the following location
filesystem/usr/share/tomcat6/lib
i.e
/usr/share/tomcat6/lib
Restart the tomcat server :
sudo /etc/init.d/tomcat7 start
sudo /etc/init.d/tomcat7 stop
Apache tomcat server can be restarted by using following single cmd also.
Apache tomcat server can be restarted by using following single cmd also.
sudo /etc/init.d/tomcat6 restart
Now Let us create a Sample JSP with Mysql connection.
test.jsp
<!DOCTYPE HTML>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<html>

