Java
-
Hibernate like method: set the condition of fuzzy query
like(String propertyName,Object value) Example 1 Criteria criteria = session.createCriteria(UserForm.class); //创建…… -
JSP JSTL < x: choose > tag: complete condition judgment
body content( and subtags) Example <%@taglib prefix="x" uri="http://java.sun.com/jsp…… -
Basic elements of Java programs
identifier keyword notes import java.applet.*; //导入java.applet包下的所有类 import java.awt.*; //导入java.a…… -
Hibernate show_ SQL attribute: Specifies whether to output SQL statements
hibernate. show_ SQL = attribute value Example <property name="hibernate.show_sql"> true </property>…… -
Hibernate configuration properties
<?xml version='1.0'encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Co…… -
Detailed explanation of Java static static modifiers: static variables, static methods and static code blocks
类名.静态成员 Static variable public static double PI = 3.14159256; Example 1 public class StaticVar { publ…… -
JSP Response. Getmaxinactivival() method: get the valid time of the session
getMaxInactiveInterval() Example <% long timeNum = session.getMaxInactiveInterval(); out.println("这个sessi…… -
-
JSP JSTL < FMT: Message > tag: reading local messages
Grammar 1 Grammar 2 subtags Example <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt…… -
Common problems and misunderstandings about Java static
Use misunderstanding public class Student { public static String name = "张三"; private static int age = 1…… -
JSP JSTL < C: remove > tag: remove tag
Example <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <c:set var="name" value="C语言…… -
JSP sessionscope object: an implicit object that accesses the session scope
${sessionScope.expression} Example ${sessionScope.user} Typical application <body> <p>EL对象使用<…… -
JSP header object: get a specific header value of HTTP request
${header.expression} Example ${header.host} ${header[host]} -
JSP Response. Getcreationtime () method: get the time when the session object was created
getCreationTime() Example <% session.setAttribute("user","zs"); long timenum = session.getCreationTime(); …… -
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…… -
-
Hibernate AVG method: calculate the average value of a column
avg(String propertyName) Example Criteria criteria = session.createCriteria(ResultForm.class); //定义Criteria对象 …… -
Hibernate load method: load entity objects through oid
load(Class theClass,Serializable id) Example Session session = sessionFactory.openSession(); //创建Session对象 Use…… -
Spring istypematch method: determines whether the JavaBean matches the specified type
isTypeMatch(String name,Class targetType) Example public static void main(String[] args){ ApplicationContext cont…… -
Spring delete method: deletes the specified entity data
delete(Object entity) Example public void delBoyUser(TbUser user){ HibernateTemplate htm = getHibernateTemplate()…… -
Java instance guessing numbers games
count=0 way=0 public class BullCows { /** * 负责调用对应的方法,实现整个案例的逻辑关系 * * @p…… -
JSP JSTL < FMT: bundle > tag: read binding message resources
body content Example <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> <fmt:bundle…… -
JSP Response. Setstatus() method: sets the status code of the response
setStatus(int sc) Example <% response.setStatus(200); %> -
Struts 2 iterator tag: tag of iterative data
< s: iterator value = "collection element" id = "ID number" status = "instance name" > < s: property / > &…… -
Hibernate generate_ Statistics property: collect statistics
hibernate. generate_ Statistics = attribute value Example <property name="hibernate.generate_statistics"> t…… -
Introduction to common methods of string API
1)char charAt (int index) 2)int codePointAt(int index) 5.0 3)int offsetByCodePoints(int startIndex,int cpCount) 5.0…… -
JSP JSTL < C: URL > tag: generate URL address tag
Syntax: Syntax format 1: Syntax format 2: Example <%@page import="java.util.*"%> <%@taglib…… -
Hibernate wascommitted method: judge whether the transaction is committed
wasCommitted() Example session.saveOrUpdate(uf); //调用插入数据方法 if(tx.wasCommitted()){ //判断事务是否已经被提…… -
Hibernate hibernate. transaction. factory_ Class attribute: sets the transaction management type
hibernate. transaction. factory_ Class = attribute value Example <property name="hibernate.transaction.factory_cl…… -
Hibernate or method: logic or operation
or(Criterion lhs,Criterion rhs) Example Criteria criteria = session.createCriteria(PersonForm.class); //定义Criteri…… -
Spring GetPassword method: get the password of the database
getpassword() Example public static void main(String[] args){ String driver = "com.MysqL.jdbc.Driver"; String …… -
Hibernate addentity method: Associate alias with entity class
Grammar 1 addEntity(Class entityClass) Example Session session = sessionFactory.openSession(); //定义Sesssion对象 ……
