{} {} $ With the difference
- # {} Is precompiled sql
- Alternatively $ {} string, i.e. placeholder placeholder is used to replace the
MYSQL index, why the index, the advantages and disadvantages
1.mysql index is guaranteed to be unique advantage of data more quickly find the desired value.
2. The disadvantage is the low maintenance efficiency, increase the time to delete indexes also need to change
grop by and order by ----- What does it mean
- group by grouping is used, the polymerization must function with, for example, sum (), avg (), etc.
- is used to sort order by default in ascending order, ending desc home is in descending order.
SQL parameters in the limit
sql limit is used to set the number of returned e.g. select * from aa limit 0,1.0 from what represents the beginning, the number 1 indicates, is a data
SQL statement optimization
WHERE + ORDER BY + LIMIT
or
WHERE + ORDER BY (multi-column) + LIMIT
The jQuery selector
1. The selector element
$ ( "P") select all p tags
$ ( "p.intro"). Select all the class = "intro" p-label
$ ( "p # demo") selects all id = "demo" p-label,
2. attribute selector
$ ( "[href]") href attribute is an element selected
$ ( "[href! = Aa ]") is not equal to aa selected elements href
3.css selector
$ ( "p"). Css ( "background-color", "red") to the background color of all p tags to red.
JSP and differences servlet, and life cycle
compiling the servlet into a jsp after ( on the servlet jsp essentially, but only identify JVM java class can not recognize jsp code, web container code into jsp jvm java code can recognize ).
jsp page display better at, servlet is better at logic control.
servlet life cycle
- Initialization phase, calls the init () method.
- Corresponding client request phase, calls the servlet () method.
- End of life, calling destroy () method.
jsp life cycle ( in fact, and almost servlet )
jsp servlet must be converted, before they can request the service, so just a few more of the translation process
- Transformation
- Compile
- Loaded and instantiated
- Initialization, call jspinit () method,
- User response phase, calling jspservlet ().
- Time to end calls jspdestroy ().
mybatis in resultMap parameter configuration, how the output column, SQL language print
// such as maps visit to the US Mission system I wrote in
<resultMap type="Shangjia" id="sj">
<result property="Sid" column="Sid"/>
<result property="Sc" column="Sc"/>
<result property="Sorimage" column="Sorimage"/>
<result property="Sname" column="Sname"/>
<result property="Pei" column="Pei"/>
<result property="Sphone" column="Sphone"/>
<collection property="cais" ofType="Scai">
<result property="Cid" column="Cid"/>
<result property="Cimage" column="Cimage"/>
<result property="Cname" column="Cname"/>
<result property="Cmoney" column="Cmoney"/>
<result property="Cmiao" column="Cmiao"/>
</collection>
</resultMap>
// many mapping, a business can have more food
property means that the name of the entity and the corresponding column is the name of the database field
As for print sql statement, only need to add myBayis in log4j can run sql statement is seen in the console.
The synchronous and asynchronous Ajax, how
Ajax in sync means that, when executed js ajax to this, and other code pages stop loading, appears suspended animation, when the Ajax finished, the page will continue to execute other code, the end state of suspended animation.
Instead asynchronous mean, to the implementation of Ajax when another page code continues to execute, there is no state of suspended animation.
As for implementation, only need to change the Ajax async, default fales, the default asynchronous. ture is synchronized.
What object class method
A total of 13 methods
United-table query
field select the query
from table (1), table (2)
the WHERE condition relationship
例如:
select s.name
from class c,student s
where s.sid =c.cid
Difference map and set of
First, look for Map
- The map is not a sub-collection interface and implementation class, map an interface
- a map value of a key, e.g. Map <k, v> where v can be repeated, but may be unique only k, k may be a Null, but only one Null
I tell you Set
- set is not repeated
- set is an unordered container, you can not guarantee the order of arrangement set
- Also the most we can have a brother null,
Finally, I would, incidentally List
- list can be repeated
- list can also have a plurality of Null
- a list is sorted containers, each holding the inserted sequence, i.e., the output sequence is inserted
Arraylist difference with Array
- Arraylist with my words, then that will automatically expand the capacity of Array
- When you can not determine the size of the array can not be determined when it is used Arraylist, or otherwise use Array, because after all, high efficiency Array