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 ,"/");
}