Tutorial 1
Download
1 / 44

Tutorial (1) - PowerPoint PPT Presentation


  • 109 Views
  • Uploaded on

Tutorial (1). Software installation. Written by: Eng. Ahmed Mohamed Abdel Ghafar , Edited by Eng. Muhammed Hammad , Eng. Hamdy Soltan & Eng. Osama Talaat. Download Software. Click any picture to go to download link …. MySQL Installer. Apache Tomcat. Java JDK.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Tutorial (1)' - umed


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Tutorial 1

Tutorial (1)

Software installation

Written by: Eng. Ahmed Mohamed Abdel Ghafar, Edited by Eng. MuhammedHammad, Eng. HamdySoltan & Eng. Osama Talaat


Download software
Download Software

Click any picture to go to download link …

MySQL Installer

Apache Tomcat

Java JDK

If you have x64 processor architecture in your computer, download both the x86 & x64 versions of the JDK.

Download MySQL Connector/J(platform independent).


Mysql server
MySql Server

Install MySQL Products


Mysql server1
MySql Server

Accept the licence


Mysql server2
MySql Server

Do not check for updates


Mysql server3
MySql Server

Choose the full setup


Mysql server4
MySql Server

You must be connected to the internet to download the missed component


Mysql server5
MySql Server

The items to be installed


Mysql server6
MySql Server

Configure MySQL Server


Mysql server7
MySql Server

Configure MySQL Server


Mysql server8
MySql Server

Set the password to: root


Mysql server9
MySql Server

Configure MySQL Server


Mysql server10
MySql Server

Samples & Examples


Mysql server11
MySql Server

Samples & Examples


Mysql server12
MySql Server

Completed …


Mysql server13
MySql Server

MySQL Workbech


Install java jdk
Install java jdk

If you have x64 processor architecture in your computer, install both the x86 & then x64 versions of the JDK.





Apache tomcat3
Apache Tomcat

Set the username and password to: root





Apache tomcat7
Apache Tomcat

  • Check that apache is running correctly, open this link: http://localhost:8080/

  • A similar page like this should appear

  • Done !!!


Run apache tomcat service at startup
Run Apache Tomcat Service at startup

Control Panel >> Administrative tools >> Services


Run apache tomcat service at startup1
Run Apache Tomcat Service at startup

Startup type: Automatic


First jsp page
First JSP Page

  • Make a new text document in your desktop.

  • Copy the following code and paste it in the text document:

    <html>

    <head>

    <title> Non Official page </title>

    </head>

    <body>

    <font face="Times New Roman" size="+3" color="#CC0099"><br><center>

    Faculty of Engineering; Computer and Systems Dept.

    </center></font>

    </body>

    </html>


First jsp page1
First JSP Page

  • Rename the text file as faculty.jsp

  • Navigate to C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps

  • Make a new folder and rename it faculty.

  • Copy the text file to this folder.

  • If you are running windows 7 you must be an administrator and you may have to make the text file at any other location and then pasting it in the “faculty” folder.

  • Go to your browser: http://localhost:8080/faculty/faculty.jsp

  • The following page should appear:


Building a test database
Building a test database

Open MySQL Workbench, Database Menu >> Query Database


Building a test database1
Building a test database

The localhost with Port Number: 3306, username: root & password: root


Building a test database2
Building a test database

Click this button to create a new database schema


Building a test database3
Building a test database

Name it faculty and click Apply




Building a test database6
Building a test database

The new empty database is created and listed in the left


Building a test database7
Building a test database

Name it students, and create new columns with the names id, FirstName & LastNames then click Apply, Apply then Finish


Building a test database8
Building a test database

Edit the table rows data


Building a test database9
Building a test database

Enter any data correspond to the field names,then click Apply, Apply and Finish


Install mysql connector j
Install MySql Connector/J

  • extract MySQL Connector/J you downloaded.

  • Copy the file named: “mysql-connector-java-xxxx-bin”

  • Paste it in

    C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib.


Testing apache tomcat and mysql together
Testing Apache Tomcat and MySQL Together

  • Make a new text document in your desktop.

  • Copy the following code and paste it in the text document:

    <%@ page import="java.sql.*" %>

    <%

    String connectionURL = "jdbc:mysql://localhost:3306/faculty?user=root;password=root";

    Connection connection = null;

    Statement statement = null;

    ResultSetrs = null;

    %>

    <html><body>

    <%


Testing apache tomcat and mysql together1
Testing Apache Tomcat and MySQL Together

try {

Class.forName("com.mysql.jdbc.Driver").newInstance();

connection = DriverManager.getConnection(connectionURL, "root", "root");

statement = connection.createStatement();

rs = statement.executeQuery("SELECT * FROM students");

while (rs.next()) {

out.println(rs.getInt("id")+rs.getString("FirstName")+rs.getString("LastName")+rs.getString("E-mail")+"<br>");

}

rs.close();

} catch(Exception e) {

System.err.println("Exception: " + e.getMessage());

} finally {

try {

if(connection != null)

connection.close();

} catch(SQLException e) {}

}

%>

</body></html>


Testing apache tomcat and mysql together2
Testing Apache Tomcat and MySQL Together

  • Rename the text file as test.jsp

  • Navigate to C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\ROOT

  • Copy the text file to this folder.

  • RESTART YOUR COMPUTER

  • Go to your browser and type in address Bar: http://localhost:8080/test.jsp

  • The database entries you have entered before must be displayed in the browser.



ad