Several technical points of SSH Development

Source: Internet
Author: User

Single Sign-on

1. Some Existing open-source SSO servers can be used

2. Use unified encryption and decryption among multiple projects, pass ticket between projects, and Judge in the filter. If yes, save the related values to the session.

 

Read/write splitting

It is best to use AOP programming. configure it in spring and then write it simply.CodeOK.

 

Notes for handling large data volumes

1. If you want to read the data before writing, you can read it all first, and then write it again. Do not read or write the repeated loop.

2. Both JDBC-based preparedstatement and batch are used to insert n data records at a time. However, it is better to clear the cache and parameters of the session and batch during use.

 

Connection conn = session. Connection ();

Conn. setautocommit (false );
Preparedstatement PS1 = conn. preparestatement (SQL );

For (ipaddress2 ipobj: modellist ){
Ps1.setstring (4, BB );
Ps1.setstring (5, DD );
Ps1.addbatch ();
If (I % 5000 = 0 ){
Ps1.executebatch ();
Conn. Commit ();
Ps1.clearbatch ();
}
}
Ps1.executebatch ();
Conn. Commit ();
Conn. Close ();

 

Encryption and decryption
Cannot encrypt "=" together as content; otherwise, garbled characters may occur.

 

Hibernate
Findbyexample: 
1. Primary keys are not supported 
2. association is not supported. 
3. null is not supported. 

 

Different Environment paths

Default name separator related to the system.
On Windows, this field is initialized as the first character that contains the system attribute file. Separator value.
On UNIX systems, the value of this field is '/'; on Microsoft Windows systems, it is '\\'.
Obtain the path eg.
URL is = clazz. getclassloader (). getresource (clazz. getname ());
String Path = is. GetFile ();
Path = stringutils. Replace (path, "% 20 ","");
If ("\". Equals (file. separator )){
Path = stringutils. removestart (path ,"/");
}

 

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.