Department of Technology 2018.4.16
1. Callable and Thread differences
The line Cheng Nen that implements the callable interface returns the execution result, and runable is not. Callable's call method allows exceptions to be thrown.
Since callable can return execution results, if a thing can be divided into more than do, and then merge the results, you can use callable
Public interface Callable<v> { V call () throws Exception;}
Public interface Runnable {public abstract void run ();
2.
3. Select 1 from where con limit 0,1; Copy create table new table like
CREATE table new Table select * from old table (table structure and data will be copied)
What is reflection: the Java Reflection mechanism is a running state in which all the properties and methods of the class can be known for any one class, and the properties and methods of any one object can be called. This dynamic gets the information of the class and the method of invoking the object
Several ways
Object. GetClass (); Objects are there, and what do they reflect?
Classes. class; There is no third type of flexibility
Class.forName (full path name)
5. Spring MVC and Spring
Parent-child relationships. Spring MVC corresponds to a context that is a child context of spring and can access properties in the spring context.
Reference: https://www.cnblogs.com/huntdream/p/6012390.html
The so-called traditional type, is the action, service, DAO Three layer architecture, based on the complex business of large company development model.
For this mode, the general spring context is controlled on the service, DAO two layer, and the thing integrity is also controlled at the service layer, while the Springmvc-servlet controls the action layer.
This result results in the following call relationships:
- Action can invoke service, DAO;
- Service, DAO cannot invoke action;
- The AOP of the spring context container cannot be applied to the action layer, but it can be done by defining it in Springmvc-servlet.xml.
//spring的上下文
WebApplicationContext ac1 = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext());
//springMVC的上下文
WebApplicationContext ac2 = RequestContextUtils.getWebApplicationContext(request);
What is the difference between callable and runable? Switch char? SQL only checks for existence, SQL copy table? Reflection? Spring MVC and Spring context differences?