"Linux" in Ubuntu deployment JSP development environment, ECLIPSE+MYSQL+JDBC

Source: Internet
Author: User
Tags mysql in file permissions tomcat server



This thing is similar to Windows in the configuration of Linux. Windows JSP development environment, in the "Javaweb" front desk development environment Configuration myeclipse6.5+jdk1.6+tomcat6.0+svn1.8 "(click Open link), Background environment configuration," MySQL "MySQL installation, Deployment and graphical (click to open link) already mentioned in two articles, how exactly is the configuration in Linux?



First, like "Linux" in the Debian configuration JDK1.7, and Linux Java Helloworld (click to open the link), first install the JDK1.7. Then, like "Linux" Installs Eclipse and HelloWorld in Ubuntu (click to open the link) and then fix an eclipse for Java EE program.



Then, enter Ctrl+alt+t open the terminal, enter the following command, with the m--mysql in lamp, do a good job of MySQL service. Just enter the command, wait for download, set the password of the database, wait for the installation. For more details, you can check out the previous "Linux" setting the Lamp Environment in Ubuntu (click to open the link).





sudo apt-get install mysql-server mysql-client





Then, like "Linux" in Ubuntu in the graphical Lamp development environment (click the Open link) in the second part, do a good job MySQL WorkBench, make MySQL graphical.



PHP in the deployment of Linux in fact, JSP many places are interlinked, especially the common database MySQL.



Next, there are different aspects of JSP and PHP.






One, tomcat downloads, installs, configuration, deployment in eclipse



1. First, we need a tomcat. Go directly to Tomcat's official website http://tomcat.apache.org/download-70.cgi and select the Linux version of Tomcat7.0 's core version.






2, it directly decompression to the main folder, easy to manage, do not change what file permissions. Also, delete the original unzip file. In fact, after the decompression, Tomcat inside the thing, and Windows is exactly the same. Just use the. Sh start and close only if you manually start Tomcat.






3. After opening the Java EE interface under Eclipse, in the blank place of the Server tab below, right-click and add a server.






4. Find TOMCAT7 Click Next






5, after, in the browsing, select the path of Tomcat, we just unzipped the place, and then remember to choose the JRE of our own configuration of the jdk1.7. Don't use Eclipse's default JDK, or you won't know what the god problem is.






6, after, because there is no Javaweb project, directly choose to complete.






7. After that, double-click on the server we just created and configure Tomcat to avoid the problem of "Javaweb" in the Eclipse for Java EE compilation of a project Tomcat under WebApps but no workaround "(Click to open link).






8, in the open window, to the server locations column, tune into use Tomcat installation (...) After that, the compiled server changes, then the Deploy path is modified to the Tomcat default WebApps and then saved to close this button.









Second, create a link MySQL database Java EE project



1. Start with a new Java EE project, and create a new dynamic Web project in the blank space of the Project Explorer tab on the left.






2, enter the Javaweb project name, such as the Javawebtest, point next, do not hurry to complete.






3. Just like the "Javaweb" Eclipse for Java EE new Web project automatically generated XML page (click to open the link), the automatic generation of XML hook, so that the Javaweb project, directly able to start.






4, after, we want to download a Mysql-connector-java-5.0.8-bin.jar thing, put to webcontent under the Web-inf under the LIB, let this Web project can connect MySQL database. This thing is also the official MySQL works. Directly open its official website http://dev.mysql.com/downloads/connector/j/5.0.html (click to open the link) This website does very rotten, if the network speed is not good, drop-down menu also does not respond. Select the old version, and then choose non-platform dependent version, that is OK, Ubuntu can also unzip the zip file.






5, after decompression, although there are many documents, but as long as the inside of the Mysql-connector-java-5.0.8-bin.jar put into the Javaweb Project Webcontent\web-inf\lib folder can be.






6. Refresh the Javawebtest project under Eclipse Engineering, then create a new JSP file under the WebContent folder.






7, named Test.jsp, where the direct point can be completed.






8. Write the following code inside:



<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "pageencoding=" UTF-8 "%><%@ page import=" java.sql.* "%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >

In fact, Java is connected to the content of MySQL database, note that the introduction of java.sql.* in the beginning, specifically, "MySQL" Java in the MySQL database additions and deletions, Java System Class (click to open the link). After writing the code, for example, right-click the Tomcat server under Server, select Add Project.

9, add this javawebtest project to Tomcat, and then start the Tomcat server.








10. You can open your own wild Fox Zen Browser until you see a prompt for the console tomcat to start successfully






input localhost:8080/javawebtest/test.jsp display "Database link Success", it proves that the JSP has been successfully deployed in Ubuntu development environment, and this JSP project has been able to successfully connect to the database!








"Linux" in Ubuntu deployment JSP development environment, ECLIPSE+MYSQL+JDBC





Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.