Recent Posts
-
Hibernate close method: close the session object
close() Example Session session = sessionFactory.openSession(); //创建Session对象 if(session.isopen()){ //如果ses…… -
Createcriteria method of Hibernate criteria interface: create a new criteria object
createCriteria(String associationPath) Example Session session = sessionFactory.openSession(); //获取session对象 C…… -
Hibernate rowcount method: returns the number of records that meet the condition
rowCount() Example Criteria criteria = session.createCriteria(UserForm.class); //创建Criteria对象 criteria.add(Res…… -
Online examination system for Java project practice (with source code and analysis)
Development background requirement analysis System objectives Functional structure System business process development…… -
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 connection. driver_ Class attribute — specifies the database driver
hibernate. connection. driver_ Class = attribute value Example 1 <property name="hibernate.connection.driver_clas…… -
Three abbreviations of Java lambda expressions
Omit parameter type public static Calculable calculate(char opr) { Calculable result; if (opr == '+') { …… -
-
JSP Request. Getsession () method: get the session object related to the request
getSession(boolean create) Example <% HttpSession ses = request.getSession(true); out.println("客户端sessio…… -
Spring queryforlong method: single value query method of long type
Grammar 1 queryForLong(String sql) Example public long getUserCount(){ String sql = "SELECT count(*)FROM tb_user"…… -
BBS forum system development of Java project practice (with source code and analysis)
Development background System functional structure System business process System development environment System Previ…… -
Spring queryformap method: query results are saved in the map collection
Grammar 1 queryForMap(String sql) Example public static void main(String[] args){ ApplicationContext context = ne…… -
Struts2 ServletActionContext. Getresponse () method: get httpservletresponse object
public static HttpServletResponse getResponse() Example //获取HttpServletResponse对象 HttpServletResponse response …… -
Java uses internal classes to implement multiple inheritance
Example 1 public class Father { public int strong() { // 强壮指数 return 9; } } pu…… -
Hibernate default_ batch_ fetch_ Size attribute: sets the default fetching quantity
hibernate. default_ batch_ fetch_ Size = attribute value Example <property name="hibernate.default_batch_fetch_si…… -
Hibernate begintransaction method: start a transaction
beginTransaction() Example Transaction tx = null; //定义事务对象 try{ tx = session.beginTransaction(); //开启…… -
Hibernate cache. provider_ Class attribute: sets the full name of the L2 cache implementation class
hibernate. cache. provider_ Class = attribute value Example <property name="hibernate.cache.provider_class"> …… -
JSP JSTL < C: otherwise > tag: Specifies the default processing logic tag
< C: otherwise > label body < / C: otherwise > Example <%@page import="java.util.*"%> <%@tag…… -
JSP JSTL < x: parse > tag: parses the specified XML content
XML Document to parse Example <%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%> <%@…… -
JSP Session. Getattribute () method: get the attribute value according to the attribute name
getAttribute(String name) Example <% session.getAttribute("user"); %> Typical application <form name=…… -
Hibernate criteria interface setfirsresult method: sets the starting point of the result set
setFirstResult(int firstResult) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria…… -
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 hibernate. order_ Updates property: sort SQL updates
hibernate. order_ Updates = attribute value <property name="hibernate.order_updates"> true </property&g…… -
JSP cookie object: access the cookie name set by the request
${cookie expression} Example <%Cookie cookie = new Cookie("user","zs"); response.addCookie(cookie); %> …… -
Spring batchupdate method: execute batch update statement
batchUpdate(String[] sql) Example public static void main(String[] args){ ApplicationContext context = new ClassP…… -
Java try catch statement
try { 逻辑代码块1; } catch(ExceptionType e) { 处理代码块1; } Example 1 import java.util.Scanner; pu…… -
Java for statement explanation
for(条件表达式1;条件表达式2;条件表达式3) { 语句块; } public static void main(String[] args) { int result=1; …… -
Struts 2 combobox tag: generates a combination of a single line text box and a drop-down list
< / s: combo@R_120_2419 @>/ / display of multiple selection boxes < / s: Form > Example &…… -
Hibernate isnull method: judge whether it is null
isNull(String propertyName) Example Criteria criteria = session.createCriteria(PersonForm.class); //创建Criteria对…… -
Hibernate query interface list method: returns the list collection of query results
list() Example Session session = sessionFactory.openSession(); //获取session对象 String hql = "from UserForm"; //…… -
The difference between Java empty string and null
String str = null; System. out. println(str.length()); if (str.length() == 0) if (str.equals("")) if (str == null) if …… -
Hibernate groupproperty method — sets the property column participating in the grouping
groupProperty(String propertyName) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criter……