This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Why do we need collection framework? | |
- If you want to represent 10,000 values, then declaring 10,000 variables | |
to represent those 10,000 values is worst programming practice. | |
Because readability of code is going to be hard. To overcome this problem | |
we should go for the next level - array concept. The biggest advantage of | |
array is we can represent huge number of values by using a single variable. | |
So, the readabilit of code is going to improve. Suppose, arrays concept is | |
not there, then we should go for the individual variables. To represent | |
10,000 values we will need 10,000 variables, then the readability of code | |
is going to go down. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Drop All Views | |
BEGIN | |
FOR i IN (SELECT view_name FROM user_views) | |
LOOP | |
EXECUTE IMMEDIATE('DROP VIEW ' || user || '.' || i.view_name); | |
END LOOP; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
for i in (select * from tabs) loop | |
execute immediate ('drop table ' || i.table_name || ' cascade constraints'); | |
end loop; | |
end; | |
/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM `eveil`.`student` | |
WHERE id = 1 | |
UNION ALL | |
SELECT * FROM `bootcamp`.`student` | |
WHERE id = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'pdo.php'; | |
//1. Create an instance of connection | |
//$pdo_obj = new Connection(); | |
//2. Connect to the server + db | |
try |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'pdo.php'; | |
//1. Create an instance of connection | |
$pdo_obj = new Connection(); | |
//2. Connect to the server + db | |
try |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'pdo.php'; | |
//1. Create an instance of connection | |
$pdo_obj = new Connection(); | |
//2. Connect to the server + db | |
try |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//This class helps to connect to the | |
class Connection{ | |
public function connect() | |
{ | |
return new PDO('mysql:host=localhost; dbname=sqlinjection2','root','root'); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Null Pointer Exception. | |
- If you are trying to access an object that does not exist. | |
For example, accesing an object whose pkid id 1 , but that has already been deleted will | |
result in Null Pointer Exception. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
|------------------------------------ | |
|1. Introductiona and Installation | |
|------------------------------------ | |
*/ | |
1. A lot of people use NetBeans with JavaFX. | |
2. You will need Java 7 for this. You will need JDK 7 or later. |