Java
-
Spring getBean method: get the JavaBean in the container
Grammar 1 getBean(String name) Example public static void main(String[] args){ ApplicationContext context = new C…… -
Hibernate connection. driver_ Class attribute — specifies the database driver
hibernate. connection. driver_ Class = attribute value Example 1 <property name="hibernate.connection.driver_clas…… -
JSP Response. Setdateheader() method: set the response header information
setDateHeader(String name,long date) Example <% long date = System.currentTimeMillis(); response.setDateHea…… -
Hibernate begin method: start transaction
begin() Example Transaction tx = session.getTransaction(); //创建Transaction示例 tx.begin(); //开启事务 -
-
Hibernate addentity method: Associate alias with entity class
Grammar 1 addEntity(Class entityClass) Example Session session = sessionFactory.openSession(); //定义Sesssion对象 …… -
Hibernate query interface setDate method: bind parameters with mapping type of date
Grammar 1 setDate(int position,Date date) Example String hql = "from UserForm where birthday=?"; //定义查询HQL语句 …… -
Baidu know website development of Java project
Development background requirement analysis feasibility study System objectives System functional structure System flo…… -
Hibernate connection. URL property: Specifies the URL to connect to the database
hibernate. connection. Url = attribute value Example 1 <property name="hibernate.connection.url"> jdbc:micr…… -
Verifying IP addresses with Java regular expressions
\d{1,3}\.\d{1,3} import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; publ…… -
JSP Response. Setcontenttype() method: sets the MIME type of the response object
setContentType(String type) Example <% response.setContentType("video/x-msvideo"); %> -
Hibernate cache. use_ second_ level_ Cache attribute: determines whether to close the L2 cache
hibernate. cache. use_ second_ level_ Cache = attribute value Example <property name="hibernate.cache.use_second_…… -
Differences between Java interfaces and abstract classes
Basic grammatical differences public interface Animal { // 所有动物都会吃 public void eat(); // 所…… -
Hibernate addclass method: load entity class
addClass(Class persistentClass) Example Configuration config = new Configuration(); //创建Configuration对象 Config…… -
Hibernate criteria interface setfirsresult method: sets the starting point of the result set
setFirstResult(int firstResult) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria…… -
JSP JSTL < FMT: formatdate > tag: format time
Example 1@H_502_112 @This example uses the < FMT: formatdate > tag to format the current time into different …… -
Hibernate alleq method: set a series of equality conditions
Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria对象 Map map = new HashMap(); /…… -
Hibernate like method: set the condition of fuzzy query
like(String propertyName,Object value) Example 1 Criteria criteria = session.createCriteria(UserForm.class); //创建…… -
Hibernate AVG method: calculate the average value of a column
avg(String propertyName) Example Criteria criteria = session.createCriteria(ResultForm.class); //定义Criteria对象 …… -
JSP Response. Isnew() method: judge whether the current user is a new user
isNew() Example <% out.print(session.isNew()); %> -
Setmaxresults method of Hibernate criteria interface: set the maximum number of returned records
setMaxResults(int maxResults) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria示…… -
Struts2 ServletActionContext. Getservletcontext() method: get ServletContext object
public static ServletContext getServletContext() Example //获取上下文 ServletContext context = ServletActionContext…… -
Spring deleteall method: deletes all entity objects in the specified collection
deleteAll(Collection entities) Example public void delBoyUser(Collection users){ HibernateTemplate htm = getHiber…… -
Spring update method: updates the specified entity object
update(Object entity) Example public static void main(String[] args){ ApplicationContext context = new ClassPathX…… -
Hibernate query interface setdouble method: bind parameters with mapping type of double
Grammar 1 setDouble(int position,double val) Example String hql = "from GoodsForm where price=?"; //定义查询HQL语句…… -
Spring GetUserName method: get the user name to access the database
getUsername() Example public static void main(String[] args){ String driver = "com.MysqL.jdbc.Driver"; String …… -
Spring saveOrUpdate method: saves or updates entity objects
saveOrUpdate(Object entity) Example 1 public static void main(String[] args){ ApplicationContext context = new Cl…… -
Addorder method of Hibernate criteria interface: sets the collation of the result set
addOrder(Order order) Example Session session = sessionFactory.openSession(); //定义session对象 Criteria criteria …… -
Object serialization control input and output
What is object serialization public interface Serializable { } serialize public ObjectOutputStream (OutputStream ou…… -
JSP Session. Getattribute () method: get the attribute value according to the attribute name
getAttribute(String name) Example <% session.getAttribute("user"); %> Typical application <form name=…… -
Online examination system for Java project practice (with source code and analysis)
Development background requirement analysis System objectives Functional structure System business process development…… -
Java 9 enhanced “diamond” syntax
List<String> strList = new ArrayList<String>(); Map<String,Integer> scores = new HashMap<Strin……