Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Updated java beautifier | 30f4a79f2d911cd0b6a24c31f968f0d23620965f | aubert@math.cnrs.fr | 2020-12-01 15:07:50 |
Worked on procedure example from java | 998ea14119a5a3f88efc4b0a126177e85151e43d | aubert@math.cnrs.fr | 2020-12-01 15:06:47 |
Brief example of calling a procedure from a program. | 1054c9d5c83fb956bdd0b8d884d5ce2c8a9a640e | aubert@math.cnrs.fr | 2020-11-30 19:00:45 |
Added solution to second exam | d8f62ded96991885a96d561db587988d453a28c8 | aubert@math.cnrs.fr | 2020-11-05 20:35:50 |
Quick fix on testing semicolons. | 7f48d88d2ed69213d803a7736df3d50330cfecd1 | aubert@math.cnrs.fr | 2020-11-03 14:14:06 |
Added simple example to test if semicolon are important in SQL querries. | 98097fb11558c08bad630fb3351f99ceb6777de7 | aubert@math.cnrs.fr | 2020-11-03 14:11:22 |
Updated spots to https. | a8daf1768395aa296bf0dd05783dd53c757d5d19 | aubert@math.cnrs.fr | 2020-10-05 16:18:44 |
Adding quiz #2 | 98e0ae5b8ce766524f60c91adb1040235e1bbf31 | aubert@math.cnrs.fr | 2020-10-02 19:00:15 |
Added exam 1 | e2f62ae4bf26fcc4b86e8665060ccf3918e7abeb | aubert@math.cnrs.fr | 2020-09-24 12:51:36 |
worked on solution to first exam. | b13ad99dd895f124df1b642fd990071fc09db294 | aubert@math.cnrs.fr | 2020-09-23 17:44:01 |
Added solution to first problem. | 0948cee47ed78dc115fd69c7bcf96a312dd3162f | aubert@math.cnrs.fr | 2020-09-18 21:43:00 |
Added solution to problem 2 of Exam #1. | 7ad20b3c0025a4de3fa00729de570c6fe9176773 | aubert@math.cnrs.fr | 2020-09-18 21:34:19 |
Added solution to project 1. | de427d78745593ab53dc70e7129b67fee1d4489c | aubert@math.cnrs.fr | 2020-09-10 19:04:45 |
Added example for MAX and NULL values. | b82a496a5ffbcecaf2c5851f18d1b08ce8732623 | aubert@math.cnrs.fr | 2020-09-10 13:14:13 |
Changed SQL code formatting. | 6c3cad5a2545f46ab113f7df7a83457857d82ed8 | aubert@math.cnrs.fr | 2020-09-09 17:04:55 |
Cleaned code. | 5bdb4faed3a83b81257734f1e1aced2890783f04 | aubert@math.cnrs.fr | 2020-09-03 21:35:41 |
Added the first project. | 564a02887933f2395bc40d7d8a10833f657659fd | aubert@math.cnrs.fr | 2020-08-28 22:34:08 |
Week 2 edits, added quiz #1, couple of fixes, replaced single quote with double quotes. | 3c9942731678900122088356db3a2cbabd99b9be | aubert@math.cnrs.fr | 2020-08-27 19:00:13 |
Added ressource for makefile. | 7696c44bca707646530a7dbb71bf2e05badaa306 | aubert@math.cnrs.fr | 2020-08-03 16:00:23 |
Crystal's final edits. | 714e3030423a836c4ba07890f9aa5e45f58ad15a | aubert@math.cnrs.fr | 2020-05-21 17:43:26 |
File notes/Makefile changed (mode: 100644) (index 788da61..ffc3395) | |||
... | ... | all: pdf odt html aux example | |
124 | 124 | .PHONY: clean_java $(JAVA_CODE) | .PHONY: clean_java $(JAVA_CODE) |
125 | 125 | clean_java: $(JAVA_CODE) | clean_java: $(JAVA_CODE) |
126 | 126 | $(JAVA_CODE): | $(JAVA_CODE): |
127 | java -jar lib/google-java-format-1.7-all-deps.jar -i $@ | ||
127 | java -jar lib/google-java-format-1.9-all-deps.jar -i $@ | ||
128 | 128 | ||
129 | 129 | ### | ### |
130 | 130 | # "Phony" rule to beautify the SQL code | # "Phony" rule to beautify the SQL code |
File notes/code/java/GuestProgramSolution.java changed (mode: 100644) (index 7f7e5e0..7267222) | |||
... | ... | public class GuestProgram_Solution { | |
75 | 75 | // start snippet exercise-2 | // start snippet exercise-2 |
76 | 76 | ResultSet rset = | ResultSet rset = |
77 | 77 | stmt.executeQuery( | stmt.executeQuery( |
78 | "SELECT * FROM GUEST, BLACKLIST WHERE GUEST.Name = BLACKLIST.Name AND GUEST.Confirmed = true"); | ||
78 | "SELECT * FROM GUEST, BLACKLIST WHERE GUEST.Name = BLACKLIST.Name AND" | ||
79 | + " GUEST.Confirmed = true"); | ||
79 | 80 | if (rset.next()) { | if (rset.next()) { |
80 | 81 | System.out.print( | System.out.print( |
81 | "Oh no, (at least) one of the guest from the black list confirmed their presence!\nThe name of the first one is " | ||
82 | "Oh no, (at least) one of the guest from the black list confirmed their presence!\n" | ||
83 | + "The name of the first one is " | ||
82 | 84 | + rset.getString(2) | + rset.getString(2) |
83 | 85 | + ".\n"); | + ".\n"); |
84 | 86 | } | } |
... | ... | public class GuestProgram_Solution { | |
86 | 88 | ||
87 | 89 | // start snippet exercise-3 | // start snippet exercise-3 |
88 | 90 | System.out.print( | System.out.print( |
89 | "Do you want to remove all the guests that are on the black list and confirmed their presence? Enter \"Y\" for yes, anything else for no.\n"); | ||
91 | "Do you want to remove all the guests that are on the black list and confirmed their" | ||
92 | + " presence? Enter \"Y\" for yes, anything else for no.\n"); | ||
90 | 93 | if (key.nextLine().equals("Y")) { | if (key.nextLine().equals("Y")) { |
91 | 94 | stmt.execute( | stmt.execute( |
92 | 95 | "DELETE FROM GUEST WHERE NAME IN (SELECT NAME FROM BLACKLIST) AND Confirmed = true;"); | "DELETE FROM GUEST WHERE NAME IN (SELECT NAME FROM BLACKLIST) AND Confirmed = true;"); |
File notes/code/java/ListPrice.java changed (mode: 100644) (index ebae1d5..85a7bd5) | |||
... | ... | public class SimpleInjection_3 { | |
22 | 22 | Scanner key = new Scanner(System.in); | Scanner key = new Scanner(System.in); |
23 | 23 | ||
24 | 24 | System.out.print( | System.out.print( |
25 | "Do you want to browse the table containing DISK, BOOK or VINYL? (please enter exactly the table name"); | ||
25 | "Do you want to browse the table containing DISK, BOOK or VINYL? (please enter exactly" | ||
26 | + " the table name"); | ||
26 | 27 | PreparedStatement ps = | PreparedStatement ps = |
27 | 28 | conn.prepareStatement("SELECT Title FROM" + key.nextLine() + "WHERE Title = ?;"); | conn.prepareStatement("SELECT Title FROM" + key.nextLine() + "WHERE Title = ?;"); |
28 | 29 | System.out.print("Enter the title you are looking for.\n"); | System.out.print("Enter the title you are looking for.\n"); |
File notes/code/java/SimpleInjection01.java changed (mode: 100644) (index 31639c2..30302c4) | |||
... | ... | public class SimpleInjection01 { | |
22 | 22 | Scanner key = new Scanner(System.in); | Scanner key = new Scanner(System.in); |
23 | 23 | ||
24 | 24 | System.out.print( | System.out.print( |
25 | "\n\nTo test the program, enter\n" | ||
26 | + "\t• \"Marcus Hells\" (without the quotes) to confirm that guessing correctly triggers the correct result,\n" | ||
27 | + "\t• \"n' OR '1' = '1\" (without the double quotes (\")) to perform an SQL injection.\n" | ||
28 | + "\t• anything else to confirm that guessing correctly triggers the correct result,\n"); | ||
25 | "\n\n" | ||
26 | + "To test the program, enter\n" | ||
27 | + "\t• \"Marcus Hells\" (without the quotes) to confirm that guessing correctly" | ||
28 | + " triggers the correct result,\n" | ||
29 | + "\t• \"n' OR '1' = '1\" (without the double quotes (\")) to perform an SQL" | ||
30 | + " injection.\n" | ||
31 | + "\t• anything else to confirm that guessing correctly triggers the correct" | ||
32 | + " result,\n"); | ||
29 | 33 | ||
30 | 34 | while (true) { | while (true) { |
31 | 35 | System.out.print("\n\nType the name of someone who may be the secret VIP.\n"); | System.out.print("\n\nType the name of someone who may be the secret VIP.\n"); |
File notes/code/java/SimpleInjection02.java changed (mode: 100644) (index b60b2d1..9454ba8) | |||
... | ... | public class SimpleInjection02 { | |
22 | 22 | Scanner key = new Scanner(System.in); | Scanner key = new Scanner(System.in); |
23 | 23 | ||
24 | 24 | System.out.print( | System.out.print( |
25 | "\n\nTo test the program, enter\n" | ||
26 | + "\t• \"Marcus Hells\" (without the quotes) to confirm that guessing correctly triggers the correct result,\n" | ||
27 | + "\t• \"nope'; DROP SCHEMA HW_SIMPLE_INJECTION_2;\" (without the double quotes (\")) to perform an SQL injection.\n" | ||
28 | + "\t• anything else to confirm that guessing correctly triggers the correct result,\n"); | ||
25 | "\n\n" | ||
26 | + "To test the program, enter\n" | ||
27 | + "\t• \"Marcus Hells\" (without the quotes) to confirm that guessing correctly" | ||
28 | + " triggers the correct result,\n" | ||
29 | + "\t• \"nope'; DROP SCHEMA HW_SIMPLE_INJECTION_2;\" (without the double quotes" | ||
30 | + " (\")) to perform an SQL injection.\n" | ||
31 | + "\t• anything else to confirm that guessing correctly triggers the correct" | ||
32 | + " result,\n"); | ||
29 | 33 | ||
30 | 34 | while (true) { | while (true) { |
31 | 35 | System.out.print("\n\nType the name of someone who may be the secret VIP.\n"); | System.out.print("\n\nType the name of someone who may be the secret VIP.\n"); |
File notes/code/java/SimpleInjection03.java changed (mode: 100644) (index 7cf6527..08f6b15) | |||
... | ... | public class SimpleInjection03 { | |
22 | 22 | Scanner key = new Scanner(System.in); | Scanner key = new Scanner(System.in); |
23 | 23 | ||
24 | 24 | System.out.print( | System.out.print( |
25 | "\n\nTo test the program, enter\n" | ||
26 | + "\t• \"Marcus Hells\" (without the quotes) to confirm that guessing correctly triggers the correct result,\n" | ||
27 | + "\t• anything else to confirm that guessing correctly triggers the correct result.\n\n" | ||
28 | + "This program uses prepared statement, and as such is extremely good at preventing SQL injections.\n\n"); | ||
25 | "\n\n" | ||
26 | + "To test the program, enter\n" | ||
27 | + "\t• \"Marcus Hells\" (without the quotes) to confirm that guessing correctly" | ||
28 | + " triggers the correct result,\n" | ||
29 | + "\t• anything else to confirm that guessing correctly triggers the correct" | ||
30 | + " result.\n\n" | ||
31 | + "This program uses prepared statement, and as such is extremely good at preventing" | ||
32 | + " SQL injections.\n\n"); | ||
29 | 33 | ||
30 | 34 | PreparedStatement ps = conn.prepareStatement("SELECT * FROM SECRETVIP WHERE Name = ?;"); | PreparedStatement ps = conn.prepareStatement("SELECT * FROM SECRETVIP WHERE Name = ?;"); |
31 | 35 |
File notes/lib/google-java-format-1.7-all-deps.jar deleted (index e2d40de..0000000) |
File notes/lib/google-java-format-1.9-all-deps.jar added (mode: 100644) (index 0000000..82c0eb9) |