Download presentation
Presentation is loading. Please wait.
Published byImogen Park Modified over 9 years ago
1
TUTORIAL (1) Software installation Written by: Eng. Ahmed Mohamed Abdel Ghafar, Edited by Eng. Muhammed Hammad, Eng. Hamdy Soltan & Eng. Osama Talaat
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).
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
21
Set the username and password to: root
22
APACHE TOMCAT
25
Check that apache is running correctly, open this link: http://localhost:8080/ 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: Non Official page Faculty of Engineering; Computer and Systems Dept.
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:
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: <% String connectionURL = "jdbc:mysql://localhost:3306/faculty?user=root;password=root"; Connection connection = null; Statement statement = null; ResultSet rs = null; %> <%
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")+" "); } rs.close(); } catch(Exception e) { System.err.println("Exception: " + e.getMessage()); } finally { try { if(connection != null) connection.close(); } catch(SQLException e) {} } %>
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.
44
DONE!! CONGRATULATIONS
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.