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
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
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
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
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
<?xml version='1.0' encoding='utf-8'?> | |
<!DOCTYPE hibernate-configuration PUBLIC | |
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" | |
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> | |
<hibernate-configuration> | |
<session-factory> | |
<!-- Database connection settings --> | |
<property name="connection.driver_class">com.mysql.jdbc.Driver</property> |
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
import java.util.Map; | |
import java.util.HashMap; | |
public class Employee{ | |
Integer empId; | |
String name; | |
@Override | |
public String toString() | |
{ |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>JenkinsEC2</groupId> | |
<artifactId>JenkinsEC2</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>war</packaging> | |
<build> | |
<sourceDirectory>src</sourceDirectory> | |
<plugins> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Disable Key in JavaScript</title> | |
<script> | |
function noenter(e) { | |
//1. window is an object that represents an open window in a browser. | |
//2. event is an action that can be detected by javascript. | |
//Sometimes we want to execute a JavaScript when an event |