TUTORIAL (1) Software installation Written by: Eng. Ahmed Mohamed Abdel Ghafar, Edited by Eng....

44
TUTORIAL (1) Software installation by: Eng. Ahmed Mohamed Abdel Ghafar, Edited by Eng. Muhammed Hammad, Eng. Hamdy Soltan & Eng. Osama

Transcript of TUTORIAL (1) Software installation Written by: Eng. Ahmed Mohamed Abdel Ghafar, Edited by Eng....

  • Slide 1
  • TUTORIAL (1) Software installation Written by: Eng. Ahmed Mohamed Abdel Ghafar, Edited by Eng. Muhammed Hammad, Eng. Hamdy Soltan & Eng. Osama Talaat
  • Slide 2
  • DOWNLOAD SOFTWARE Click any picture to go to download link MySQL InstallerApache TomcatJava JDK If you have x64 processor architecture in your computer, download both the x86 & x64 versions of the JDK. Download MySQL Connector/JDownload MySQL Connector/J (platform independent).
  • Slide 3
  • MYSQL SERVER Install MySQL Products
  • Slide 4
  • MYSQL SERVER Accept the licence
  • Slide 5
  • MYSQL SERVER Do not check for updates
  • Slide 6
  • MYSQL SERVER Choose the full setup
  • Slide 7
  • MYSQL SERVER You must be connected to the internet to download the missed component
  • Slide 8
  • MYSQL SERVER The items to be installed
  • Slide 9
  • MYSQL SERVER Configure MySQL Server
  • Slide 10
  • MYSQL SERVER Configure MySQL Server
  • Slide 11
  • MYSQL SERVER Set the password to: root
  • Slide 12
  • MYSQL SERVER Configure MySQL Server
  • Slide 13
  • MYSQL SERVER Samples & Examples
  • Slide 14
  • MYSQL SERVER Samples & Examples
  • Slide 15
  • MYSQL SERVER Completed
  • Slide 16
  • MYSQL SERVER MySQL Workbech
  • Slide 17
  • INSTALL JAVA JDK If you have x64 processor architecture in your computer, install both the x86 & then x64 versions of the JDK.
  • Slide 18
  • APACHE TOMCAT
  • Slide 19
  • Slide 20
  • Slide 21
  • Set the username and password to: root
  • Slide 22
  • APACHE TOMCAT
  • Slide 23
  • Slide 24
  • Slide 25
  • Check that apache is running correctly, open this link: http://localhost:8080/ http://localhost:8080/ A similar page like this should appear Done !!!
  • Slide 26
  • RUN APACHE TOMCAT SERVICE AT STARTUP Control Panel >> Administrative tools >> Services
  • Slide 27
  • RUN APACHE TOMCAT SERVICE AT STARTUP Startup type: Automatic
  • Slide 28
  • FIRST JSP PAGE Make a new text document in your desktop. Copy the following code and paste it in the text document: Non Official page Faculty of Engineering; Computer and Systems Dept.
  • Slide 29
  • 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.jsphttp://localhost:8080/faculty/faculty.jsp The following page should appear:
  • Slide 30
  • BUILDING A TEST DATABASE Open MySQL Workbench, Database Menu >> Query Database
  • Slide 31
  • BUILDING A TEST DATABASE The localhost with Port Number: 3306, username: root & password: root
  • Slide 32
  • BUILDING A TEST DATABASE Click this button to create a new database schema
  • Slide 33
  • BUILDING A TEST DATABASE Name it faculty and click Apply
  • Slide 34
  • BUILDING A TEST DATABASE Apply
  • Slide 35
  • BUILDING A TEST DATABASE Finish
  • Slide 36
  • BUILDING A TEST DATABASE The new empty database is created and listed in the left
  • Slide 37
  • BUILDING A TEST DATABASE Name it students, and create new columns with the names id, FirstName & LastNames then click Apply, Apply then Finish
  • Slide 38
  • BUILDING A TEST DATABASE Edit the table rows data
  • Slide 39
  • BUILDING A TEST DATABASE Enter any data correspond to the field names,then click Apply, Apply and Finish
  • Slide 40
  • 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.
  • Slide 41
  • 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")+" "); } rs.close(); } catch(Exception e) { System.err.println("Exception: " + e.getMessage()); } finally { try { if(connection != null) connection.close(); } catch(SQLException e) {} } %>
  • Slide 43
  • 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 http://localhost:8080/test.jsp The database entries you have entered before must be displayed in the browser.
  • Slide 44
  • DONE!! CONGRATULATIONS