- Use an ssh terminal such as PuTTY to connect to apollo.humber.ca
- Once logged in type:
[n12345678@apollo ~]$ sqlplus
- enter your username and password.
- next change your password (and record it) by entering the following and following the prompts:
SQL> password
- Show your SQL prompt to your professor.
- to exit type:
SQL> quit
- Use Oracle's SQL Developer
- From the Windows start menu Run SQL developer
- Confirm the dialogs
- On the left hand menu click the green plus button.
- On the form that pops up fill in the information that follows:
Connection Name: choose a name (e.g. apollo_oracle)
Username: your humber id (e.g. n12345678)
Password: your password as you chose above
Hostname: apollo.humber.ca
Port: 1521
SID: msit
- Select the TEST button to verify.
- Select connect.
- Go to Oracle SQL by Example/Alice Rischert.
- Download the scripts.exe file.
- After you download the file, double click on scripts.exe file and unzip the files to the C:\guest\schemasetup directory.
- In SQL Developer Click File Open.
- Click the Browse button to locate in the C:\guest\schemasetup directory the script named createStudent.sql
- Open the file, which brings it into the worksheet.
- Click the Run Script icon or F5 to run the script.
- After the script completes (approximately 3-5 minutes), it will show a list of counts representing the number of rows it created for each table. Compare that list on screen with the following list. The two lists should match. If you used SQL Developer, you may need to scroll all the way to the bottom of the screen to see the result.
Count of COURSE Table: 30
Count of ENROLLMENT Table: 226
Count of GRADE Table: 2004
Count of GRADE_CONVERSION Table: 15
Count of GRADE_TYPE Table: 6
Count of GRADE_TYPE_WEIGHT Table: 300
Count of INSTRUCTOR Table: 10
Count of SECTION Table: 78
Count of STUDENT Table: 268
Count of ZIPCODE Table: 227
- Click the Browse button to locate in the C:\guest\schemasetup directory the script named sql_book_add_tables.sql
- Open the file, which brings it into the worksheet.
- Click the Run Script icon or F5 to run the script.
- Select your apollo_oracle connection tab.
- Type SELECT * FROM COURSE
- Click the Run Script icon or F5 to run the script.
- Show the output of the command in SQL Developer to your professor.
- Login to Lynda.com
- Visit lynda.com website
- Click 'Sign In' button
- Click Organization Login tab (NOT Individual Login)
- Enter 'www.humber.ca' under organization's URL
- Click 'Go' and you will be redirected to login.humber.ca
- Enter your Humber username and password and click 'LOGIN' button
- You will be redirected back to Lynda.com with full course access to create your own user name.
- Feel free to register via Toronto Public Library instead such that your access is not cut off when you graduate.
- Go to Programming Foundations: Databases and show that the "Welcome" video from the Introduction has been marked viewed (perhaps without sound) your professor.
- Friday's quiz will be based on Chapter 1 Understanding Databases and Chapter 2 Database Fundamentals. It is only about half an hour of videos and you are expected to spend about an hour outside of class for every hour in class.
- Extra consideration: email me any file I/O code you wrote in CENG 212 Programming Techniques in Java.
Assignment #1
Assignment #2
Assignment #3
Assignment #4
Assignment #5
Assignment #6
Assignment #7
Assignment #8
- Use JDBC to scroll through a result set using NetBeans SE installed on the school computers with our Oracle Database.
- Chapters 3 and 4 of https://www.lynda.com/Java-tutorials/Java-Database-Integration-JDBC/110284-2.html will help you with this task.
- Write it to a .csv file (discussed in class April 6th).
- Optional: use a prepared statement and/or stored procedure instead of a static SQL statement.
- Use an ssh terminal such as PuTTY to connect to munro.humber.ca
- Once logged in type:
[n12345678@munro ~]$ cd public_html
- Create the directory:
/home/students/n12345678/public_html/ceng254
- Set appropriate permissions.
- Change to that directory and create an index.jsp again with appropriate permissions.
- Complete Learning Java Applications Chapter 6 in the lab using this environment by using the following instead:
<!-- will be hosted at http://munro.humber.ca/~n12345678/ceng254/index.jsp -->
<%@page import = "java.sql.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
<p>
<ul>
<%
Connection c = DriverManager.getConnection("jdbc:oracle:thin:@apollo.humber.ca:1521:msit" ,"n12345678", "ORACLE");
Statement s = c.createStatement();
String query = ("SELECT * FROM medri.labtenstudent");
ResultSet result = s.executeQuery(query);
while (result.next()) {
%>
<li><%= result.getString("first_name") %></li>
<%
}
c.close();
%>
<ul>
</p>
</body>
</html>
- For Friday's quiz you will be expected to hand write the URL to your working JSP page.