1. Top Ten security risks of Web Applications
1) SQL injection 2) cross-site scripting (XSS) attacks (Cross Site Scripting) 3) corrupted authentication and session management 4) unsafe objects direct reference 5) cross-Site Request Forgery (csrf)
6) security misconfiguration 7) restrict unauthenticated redirection and transmission
9) insecure encrypted storage 10) Insufficient transport layer protection
2. Temporary Oracle table
Temporary transaction table:
Create global temporary table temp_user
(ID number (12) primary key, name varchar2 (10 ))
On commit Delete rows;
Session temporary table:
Create Global tempopary table temp_user
(ID number (12) primary key, name varchar2 (10 ))
On commit preserve rows;
Differences:
Transaction temporary table. After the transaction is committed, the data in the table disappears, but the session temporary table does not !~
The session temporary table can still be queried after the transaction is committed. However, after the data is closed, the data in the table disappears after the data is reconnected !~
3. Query of null values
Create Table tmp_test
(ID int not null primary key,
Username varchar2 (30 ),
Nickname varchar2 (50 ),
Address varchar2 (300)
);
Commit;
Insert into tmp_test
Values (1, '123', 'jack', 'shenzhen ');
Insert into tmp_test
Values (2, '20140901', null, 'shanghai ');
Insert into tmp_test
Values (3, '000000', '', 'wuhan ');
Commit;
Select * From tmp_test
Where nickname not in ('jack ');
Select * From tmp_test
WhereNvl (nickname ,'#')Not in ('jack ');
4. Spring IoC and AOP
IOC: Control inversion is also called dependency injection. Using the factory Model
You only need to configure the corresponding bean in the spring configuration file and set relevant attributes so that the spring container can generate class instance objects and manage objects. When the spring container is started, spring initializes all the beans you configured in the configuration file, and when you need to call the bean, assign the beans it has initialized to the classes that you need to call these beans (assuming the Class Name Is A). The allocation method is to call the setter method of a for injection, you don't need to create new beans in.
AOP: Aspect-Oriented Programming
Oop allows you to define the relationship from top to bottom, but it is not suitable for defining the relationship from left to right. For example, log function. Log Code is often horizontally distributed across all object layers, but it has nothing to do with the core functions of the objects it spreads.
Encapsulate the cross-business logic (such as security, logs, and transactions) in a program into a plane and inject it into the target object (specific business logic.
5. Spring thing Management
Declarative transactions (based on AOP and transactionmanager) and programmatic transactions
Http://lzh166.iteye.com/blog/1134146
Http://blog.csdn.net/java_min/article/details/4427523
6. Filters and interceptors
Filter: the filter intercepts the path configured by the filter in Web. XML in one way. When the request matches the path of the filter, the filter intercepts the path one way.
Interceptor: Interceptor does not process the request. It only takes effect for the action and intercepts the request in both directions.
Filters are based on callback functions. The dofilter method in the filter interface we need to implement is the callback function, while interceptor is based on the reflection mechanism of Java.
Filter depends on the servlet container, that is, it can only be executed in the servlet container. Obviously, the dofilter method cannot be called back and forth without the servlet container. Interceptor has nothing to do with servlet containers.
The filter range is larger than Interceptor. In addition to filtering requests, the filter can use wildcards to protect pages, images, files, and so on. interceptor can only filter requests.
The filter exception is usually declared in the init method during loading, while interceptor can identify whether to filter by declaring the XML request as a guest request or a user request.
Http://blog.csdn.net/x_yp/article/details/6358630
7. Oracle connect
Select level, count (level)
From employee_lamar E
Start with (E. dept_id = '2013' and E. manager_emp_id is null)
Connect by prior E. emp_id = E. manager_emp_id
Group by level
Order by level;
8. Oracle custom Variables
1) TypeV_name table_name.column_name % Type
V_ename EMP. ename % Type
Select ename into v_ename from EMP where empno = 7900;
2) rowtypeV_name table_name % rowtype
V_row EMP % rowtype
Select X into v_row from EMP where empno = 7900;
Dbms_output.put_line ('ename = '| v_row.ename );
3) record type
The custom type is usually put in the package.
Create or replace package my_package
As
-- Customize a type
Type mytype is record (
Xm emp. ename % type, -- name
Gzuo EMP. Job % type, -- work
Gzi EMP. Sal % Type -- Salary
);
End;
Then you can directly use this type in the program block.
Declare
-- Use the custom type in the package to define the variable
Myvalue my_bao.mytype;
Begin
Select ename, job, Sal into myvalue from EMP where empno = 7844;
Dbms_output.put_line ('ename = '| myvalue. XM );
Dbms_output.put_line ('job = '| myvalue.gz uo );
Dbms_output.put_line ('sal = '| myvalue.gz I );
End;
4) Table type
Syntax: type name is table of value type index by key type
Value Type: indicates the type key type of the actually stored data. There are two types: binary_integer or pls_integer.
Example: index with strings
Declare
-- Define the table structure
Type mytabtype is table of char (2) index by varchar2 (5 );
Sextab mytabtype;
V_sex_code varchar2 (5 );
V_sex_name char (2 );
Begin
-- Add content to the table
Sextab ('nan '): = 'male ';
Sextab ('nv '): = 'female ';
-- User input
V_sex_code: = '& Gender No ';
V_sex_name: = sextab (v_sex_code );
Dbms_output.put_line ('your gender is = '| v_sex_name );
End;
Summary of development technical knowledge points