1 / 44

Tutorial (1)

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.

umed
Download Presentation

Tutorial (1)

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tutorial (1) Software installation Written by: Eng. Ahmed Mohamed Abdel Ghafar, Edited by Eng. MuhammedHammad, Eng. HamdySoltan & Eng. Osama Talaat

  2. 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).

  3. MySql Server Install MySQL Products

  4. MySql Server Accept the licence

  5. MySql Server Do not check for updates

  6. MySql Server Choose the full setup

  7. MySql Server You must be connected to the internet to download the missed component

  8. MySql Server The items to be installed

  9. MySql Server Configure MySQL Server

  10. MySql Server Configure MySQL Server

  11. MySql Server Set the password to: root

  12. MySql Server Configure MySQL Server

  13. MySql Server Samples & Examples

  14. MySql Server Samples & Examples

  15. MySql Server Completed …

  16. MySql Server MySQL Workbech

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

  18. Apache Tomcat

  19. Apache Tomcat

  20. Apache Tomcat

  21. Apache Tomcat Set the username and password to: root

  22. Apache Tomcat

  23. Apache Tomcat

  24. Apache Tomcat

  25. Apache Tomcat • Check that apache is running correctly, open this link: http://localhost:8080/ • A similar page like this should appear • Done !!!

  26. Run Apache Tomcat Service at startup Control Panel >> Administrative tools >> Services

  27. Run Apache Tomcat Service at startup Startup type: Automatic

  28. 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>

  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.jsp • The following page should appear:

  30. Building a test database Open MySQL Workbench, Database Menu >> Query Database

  31. Building a test database The localhost with Port Number: 3306, username: root & password: root

  32. Building a test database Click this button to create a new database schema

  33. Building a test database Name it faculty and click Apply

  34. Building a test database Apply

  35. Building a test database Finish

  36. Building a test database The new empty database is created and listed in the left

  37. Building a test database Name it students, and create new columns with the names id, FirstName & LastNames then click Apply, Apply then Finish

  38. Building a test database Edit the table rows data

  39. Building a test database Enter any data correspond to the field names,then click Apply, Apply and Finish

  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.

  41. 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> <%

  42. 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>

  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 • The database entries you have entered before must be displayed in the browser.

  44. Done!! Congratulations

More Related