2016-4-5 Q Questions, answers and see the Harvest

Source: Internet
Author: User

1.uniqueidentifier Data type:

The uniqueidentifier data type in the database stores a 16-byte binary value, which acts like a globally unique marker (GUID). Cannot act on a table association because it is globally unique.

2.sqlserver Database Data Interaction:

    • The best way is to do the view, cross-Library query, because the data homology, there is no data inconsistency
    • Use scripts to manipulate data when you need to synchronize specific data
    • When you need to synchronize specific data, you can also call a stored procedure implementation using a script (this method is better than the previous method)

3. Inheritance Overrides:

Problem:

is when the subclass creates the object, it copies the fields and methods of the parent class, and if the subclass overrides the parent method, the overridden method in the memory sub-class overrides the method copied from the parent class, and if the subclass defines a method with the same name, in memory it is supposed to be behind the method of the parent class copy, and the compilation order is But why would calling a subclass define a method of the same name, rather than calling a copy of the parent class? The code is as follows: Public classBird {PrivateString type = "Bird";  Publicvirtual String ShowType () {return"Bird"; }    }     Public classChicken:bird {PrivateString type = "Chicken";  Public Newstring ShowType () {return"Chicken"; }} is called as follows: Bird Bird=NewChicken (); Chicken Chicken=NewChicken (); String str1=Bird.            ShowType (); String str2=Chicken. ShowType (); Why STR1 returned is bird, this understanding. But why is str2 returning to chicken? 

Answer:

    • Subclass using public new String ShowType ()

      This new is the meaning of overriding the parent class.

      Most of the syntax of the code is a bit closer to the principle of taste

    • In C #, the name of a method in a derived class can be the same as the name of a method in a base class. You can specify how the method interacts by using the new and override keywords. The override modifier extends the base class method, and the new modifier " hides " it.

    • Because a reference to a parent type and a subtype has access to a zone in a subclass, or to an access restriction.

    • The subclass inherits the parent class's method to be able to use directly, may modify the original method on the original basis to satisfy own need . so the general situation of the rewrite is not to use, sub-class to meet their own needs of the parent class will be used, in turn, if in accordance with the concept of memory sequencing, then what is the meaning of rewriting? Rewriting is also for many sub-objects to implement different behavior (overriding the concept of extension), overriding is to overwrite the parent class from the parent class inherits from the method is not to overwrite the child class subclass from the parent class inherits the method, should be chicken, even if you do not inherit the parent class, is also chicken

    • is a chicken instance, new is a new method, so there are two ShowType in the method table.

      Although the names are called ShowType, the declaration types of the method identifiers are different, bird.showtype and Chicken.showtype, respectively.

      Directly see type also know is called which, the first str1 is bird, the second str2 is Chicken.

4.jQuery:

Problem:

In Java how to use jquery to form the form of the submission, and through the servlet or framework to obtain the form of the submission data, can solve the garbled problem, you want to save the form submitted data to the database, so how to achieve the great God advice one or two thank you

Answer:

Form form submission: $ ("#formid"). Submit (); background fetch: STRUTS2 writes a variable in the Java class: The variable name is consistent with the name value on the page and has a get and set method for the variable, using get to take the value. Garbled problem:1. View page encoding 2. Form submitted by post 3. Action Add request (). Setcharacterencoding ("GBK"  ); Response (). Setcharacterencoding ("GBK"); 4new  String (Facecontext.getparameter ("Dbld" +i). GetBytes ("Iso-8859-1"), "GBK"); Data storage: This is a lot of ways? JDBC, hibernate,ibatis, etc.

  

    

2016-4-5 Q Questions, answers and see the Harvest

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.