Java
-
-
JSP Response. Setmaxinactivival() method: set the validity period of the session
setMaxInactiveInterval(int interval) Example <% session.setMaxInactiveInterval(30); %> -
Detailed explanation of Java if else statement
If statement syntax if ( 条件表达式) { 语句块; } Example 1 import java.util.Scanner; public class Test07 …… -
JSP Response. Getcreationtime () method: get the time when the session object was created
getCreationTime() Example <% session.setAttribute("user","zs"); long timenum = session.getCreationTime(); …… -
Hibernate or method: logic or operation
or(Criterion lhs,Criterion rhs) Example Criteria criteria = session.createCriteria(PersonForm.class); //定义Criteri…… -
Spring geturl method: get the URL path to access the database
getUrl() Example public static void main(String[]args){ String driver = "com.MysqL.jdbc.Driver"; String url = …… -
JSP Response. Getservletcontext() method: returns the ServletContext object to which the session belongs
getServletContext() Example <% ServletContext sc = session.getServletContext(); %> -
Hibernate GT method: set greater than condition
gt(String propertyName,Object value) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Crit…… -
Deep analysis of Java synchronized implementation principle
Implementation principle of Java synchronized public class SynchronizedTest { public synchronized void test1(){…… -
Hibernate ID method: projection object identifier
id() Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria对象 criteria.setProjection…… -
The difference between dynamic web pages and static web pages
Static web page Dynamic web page Advanced -
Mutual conversion of Java array and string
Convert string to array String str = "123abc"; char[] arr = str.tocharArray(); // char数组 for (int i = 0; i &l…… -
Struts actionsupport class: Business Controller
import com. opensymphony. xwork2. ActionSupport; // Inherit actionsupport base class public class XXX extends actionsu…… -
JSP Response. Removeattribute() method: removes the specified session attribute
removeAttribute(String name) Example <% session.removeAttribute("user"); %> -
Hibernate hibernate. order_ Updates property: sort SQL updates
hibernate. order_ Updates = attribute value <property name="hibernate.order_updates"> true </property&g…… -
Three abbreviations of Java lambda expressions
Omit parameter type public static Calculable calculate(char opr) { Calculable result; if (opr == '+') { …… -
Spring GetType method: get the type of JavaBean
getType(String name) Example public static void main(String[] args){ ApplicationContext context = new ClassPathXm…… -
Springweb < form: input > tag: defines the text box input component of the form
Example <form:form> 用户名:<form:input maxlength="10" path="userName"/> <!--输入密码的文本框限…… -
Java digital to RMB reading method (with source code and analysis)
More than 12 will not be considered for the time being. import java.util.Arrays; import java.util.Scanner; publi…… -
Spring GetPassword method: get the password of the database
getpassword() Example public static void main(String[] args){ String driver = "com.MysqL.jdbc.Driver"; String …… -
Spring setusername method: set the user name to access the database
setUsername(String username) Example DriverManagerDataSource dmd = new DriverManagerDataSource(); dmd.setUsername("…… -
Hibernate count method: returns the number of attributes
count(String propertyName) Example Criteria criteria = session.createCriteria(UserForm.class); //定义Criteria对象 …… -
Hibernate close method: close the sessionfactory object
close() Example sessionFactory = config.buildSessionFactory(); //创建SessionFactory对象 if(sessionFactory.isClosed…… -
Hibernate wasrolledback method: judge whether the transaction is rolled back
wasRolledBack() Example try{ tx = session.beginTransaction(); //开启事务 UserForm uf = new UserForm(); //定…… -
Java final modifier: final modifier attribute, final modifier method and final modifier class
1. Final modifies the attributes in the class 2. Methods in final modifier class 3. Final modifier class Example 1 p…… -
Hibernate criteria interface list method: returns a list collection
list() Example Session session = sessionFactory.openSession(); //获取session对象 List list = null; try{ Criter…… -
Java object type conversion and forced object type conversion
Example 1 Animal:动物 Animal:可爱的动物 Cat:吃饭 Animal:动物在吃饭 Cat:可爱的小猫 Cat:猫喜欢吃鱼 Force ob…… -
Hibernate query interface setparameter method: bind parameters of any type
setParameter(String name,Object val) Example String hql = "from UserForm where username=:userName"; //定义查询HQL语…… -
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(); //开启事务