Graduation design to do the topic, the environment I took two days. The online tutorials are so broken.
My needs are this, I have an Android app needs to exchange information with the database on the computer, to implement additions and deletions, so no matter what method, the computer must have a server environment. Now I'm going to talk about how to build the environment.
The first installation package that needs to be downloaded is: Java,jdk,mysql,tomcat,myeclipse,mysql-connector (Mysql-connector-java-5.1.37-bin.jar) and so on.
The first step: Java and JDK installation. Download the corresponding version from the official website, click Install Next Next, there are countless tutorials on the web, but also to configure environment variables and so on.
Step two: Tomcat installation. Download the corresponding version from the official website http://tomcat.apache.org/download-70.cgi, download down is a compressed package, directly decompression can. Compressed package version is also very useful, the specific tutorial see http://www.cnblogs.com/Johness/archive/2012/07/20/2600937.html
The third step: the installation of Tomcat after the installation of MySQL and MyEclipse online tutorial is also a lot of scratch, there is no need to pay attention to the place.
Fourth step: Connect Tomcat with MyEclipse in order to verify that the connection requires a new Web project, no code is written and can be configured directly. When configuring MyEclipse to connect with Tomcat, in addition to connecting your own tomcat, you can cancel MyEclipse's own tomcat. As shown in.
After configuring MyEclipse, you also publish your project to Tomcat. To access the JSP you wrote through the browser
tutorials See http://jingyan.baidu.com/article/597a064397d47a312a52434f.html
When all is done, enter localhost/test/test in the browser and the name of your project will see the index.jsp page. If you do not see a description of the configuration error, double-check.
Fifth step: Configure MySQL to project at this time need to download the connector http://dev.mysql.com/downloads/connector/j/downloaded after the decompression
We need the jar shown. Specific tutorials can be found in http://www.cnblogs.com/laifu/p/3380349.html
There's a hole in it. This red box position is automatically, if you do not change the last time you test Driver must be wrong, it also prompts you to be a URL error.
Change this place to Com.mysql.jdbc.Driver, because your URL is written in Jdbc:mysql://
In this tutorial, the second step of configuring DB browser does not affect the project connection database, but can be directly in the MyEclipse to see the database you want to use
In addition, the JSP code in the tutorial is written according to his database, you need to make some changes, such as database connection password, table name and so on.
Change all to save later, do not need to run. Then visit localhost/test/in the browser you will find in Class.forName ("Com.mysql.jdbc.Driver"); This sentence has been wrong!! Not even the database!! What's going on, Odoke AH. It's almost over.
It doesn't matter, it's because you have another one that hasn't been done. That's to put the connector package you just downloaded into Tomcat's lib directory.
OK, this is all over, you can refresh the page to see the index.jsp you just saved.
Well. Finally, don't forget that I want to let the mobile phone access to the computer's server to send the JSON data, it is necessary to ensure that the phone and computer in a LAN. Mobile phone connected to the computer's wifi is on a LAN. Then, the phone can also be seen in the browser you write JSP page Oh. Mobile browser access to your computer ip/test/can see the same as the computer page, where the IP can not write localhost 127.0.0.1, to be filled out according to specific circumstances. If the phone is connected to the computer WiFi, the computer is the gateway to the phone, here to fill the phone's gateway address.
Tomcat+myeclipse+mysql Environment Construction