Write Java Web frame notes from scratch __java

Source: Internet
Author: User
On the design of table structure

1. It is suggested that the field name is lowercase and if multiple words are separated by an underscore.
2. It is recommended that each table have a unique primary key field, and the field name is an ID, and you can use the self-added primary key.
3. Data types as unified as possible, do not appear too many data types. about the use of log4j

Log4j.rootlogger=error,console,file
The above configuration indicates that the log level is set to error and provides two kinds of log appender, console and file respectively, which need to be configured separately for these two types of logs

Log4j.logger.org.smart4j=debug
Specifies that only classes under the ORG.SMART4J package can output debug-level logs on the use of threadlocal

When using static member variables in a class, be sure to ask yourself whether this static member variable needs to be considered thread-safe. So does multiple threads need to enjoy their own member variables? If you need to consider, you may want to use threadlocal database transactions

How do I get the default transaction isolation level for a database?

DatabaseMetaData meta = Dbutil.getdatasource (). getconnection (). GetMetaData ();
int defaultisolation = Meta.getdefaulttransactionisolation ();

How does a database isolate a transaction?
Use lock this thing, when inserting the data to lock the table; Lock line TIPS when data is updated

1. In the MAVEN project Main/java, Main/resources, Test/java, test/resources these four directories are the root directory of Classpath
2.Controller, in the ordinary request can return JSP page; The JSON data needs to be returned under the AJAX request

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.