Recent Posts
-
Java calculates (judges) constellations based on the date of birth
白羊:0321~0420 天秤:0924~1023 金牛:0421~0521 天蝎:1024~1122 双子:0522~0621 射手:1…… -
Detailed explanation of java file class (file operation class)
Get file properties Example 1 public class Test02 { public static void main(String[] args) { String pa…… -
Hibernate Max method: calculate the maximum value of a column
max(String propertyName) Example Criteria criteria = session.createCriteria(ResultForm.class); //获取Criteria对象 …… -
Object serialization control input and output
What is object serialization public interface Serializable { } serialize public ObjectOutputStream (OutputStream ou…… -
Hibernate addclass method: load entity class
addClass(Class persistentClass) Example Configuration config = new Configuration(); //创建Configuration对象 Config…… -
Hibernate query interface setparameter method: bind parameters of any type
setParameter(String name,Object val) Example String hql = "from UserForm where username=:userName"; //定义查询HQL语…… -
JSP Response. Removeattribute() method: removes the specified session attribute
removeAttribute(String name) Example <% session.removeAttribute("user"); %> -
Hibernate addscalar method: returns a combination of scalar and entity
addScalar(String columnAlias,Type type) Example String sql = "select avg(result.english)as avgEnglish from tb_result…… -
Java interface: definition and implementation of interface, definition and implementation of interface
Define interface public interface A { publicA(){…} // 编译出错,接口不允许定义构造方法 } public interface…… -
Spring getservletcontext method: get ServletContext context
getServletContext() Example public class LoginAction extends AbstractController{ @Override protected ModelAn…… -
Spring queryforobject method: the result of the query is returned as an object type
queryForObject(String sql,Class requiredType) Example public static void main(String[] args){ ApplicationContext …… -
Spring saveorupdateall method: saves or updates the collection of entity objects
saveOrUpdateAll(Collection entities)@H_ 403_ 3 @ Parameter Description: Example 1 public static void main(String[] a…… -
Hibernate commit method: commit transaction
翻译错误 Invalid Access Limit Example Session session = sessionFactory.openSession(); //定义Session对象 Transactio…… -
JSP JSTL < SQL: param > tag: specify SQL parameters
parameter value Example <%@page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%&…… -
Struts 2 < include > element: contains other configuration files
Syntax: …….. < include file="file"/> Example <!DOCTYPE struts PUBLIC "-//Apache Software Foundatio…… -
Spring setpassword method: set the password to connect to the database
setPassword(String password) Example DriverManagerDataSource dmd = new DriverManagerDataSource(); dmd.setPassword(p…… -
Hibernate cache. region_ Prefix attribute: sets the prefix name of the L2 cache
hibernate. cache. region_ Prefix = attribute value Example <property name="hibernate.cache.region_prefix"> …… -
Hibernate EQ method: set equal condition
eq(String propertyName,Object value) Example Criteria criteria = session.createCriteria(UserForm.class); //定义Crit…… -
Hibernate min method: calculate the minimum value of a column
min(String propertyName) Example Criteria criteria = session.createCriteria(ResultForm.class); //获取Criteria对象 …… -
Addorder method of Hibernate criteria interface: sets the collation of the result set
addOrder(Order order) Example Session session = sessionFactory.openSession(); //定义session对象 Criteria criteria …… -
Differences between Java interfaces and abstract classes
Basic grammatical differences public interface Animal { // 所有动物都会吃 public void eat(); // 所…… -
Java object type conversion and forced object type conversion
Example 1 Animal:动物 Animal:可爱的动物 Cat:吃饭 Animal:动物在吃饭 Cat:可爱的小猫 Cat:猫喜欢吃鱼 Force ob…… -
Struts actionsupport class: Business Controller
import com. opensymphony. xwork2. ActionSupport; // Inherit actionsupport base class public class XXX extends actionsu…… -
Java imitation landlords shuffle licensing games
public class Main { public static void main(String[] args) { // 1. 准备牌 String[] arr1 = { "…… -
Implementation of java example air ticket discount in low and peak seasons
Use if else statement to realize air ticket discount in low and peak seasons public static void main(String[] args) …… -
JSP JSTL < C: redirect > tag: redirect tag
Syntax format 1: …… Syntax format 2: Example <%@taglib prefix="c" uri="http://java.sun.com/jsp/j…… -
Java collection interface
Example 1 public static void main(String[] args) { ArrayList list1 = new ArrayList(); // 创建集合 list1 Ar…… -
Springweb < form: Options > tab: defines multiple options for a drop-down selection box or list box
Example 1 public class Fans{ List fanList = new ArrayList(); //定义一个List集合 public List getFanList(){ /…… -
Hibernate rollback method: rollback transaction
rollback() Example Transaction tx = null; try{ Session session = sessionFactory.openSession(); //定义Session…… -
Createalias method of Hibernate criteria interface: establish connection query
Grammar 1 createAlias(String associationPath,String alias) Example Session session = sessionFactory.openSession(); …… -
Hibernate criteria interface setprojection method: sets the projection column of the query
setProjection(Projection projection) Example 1 Criteria criteria = session.createCriteria(UserForm.class); //示例化…… -
Spring executefind method: callback query operation
executeFind(HibernateCallback action) Example public List getSmallUser(final Integer ID){ HibernateTemplate htm =……