Java
-
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"> …… -
Java calculates (judges) constellations based on the date of birth
白羊:0321~0420 天秤:0924~1023 金牛:0421~0521 天蝎:1024~1122 双子:0522~0621 射手:1…… -
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"> …… -
Hibernate close method: close the session object
close() Example Session session = sessionFactory.openSession(); //创建Session对象 if(session.isopen()){ //如果ses…… -
Hibernate opensession method: open a session
Grammar 1 openSession() Example SessionFactory sessionFactory = config.buildSessionFactory(); Session session = ses…… -
Hibernate configuration properties
<?xml version='1.0'encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Co…… -
Java instance guessing numbers games
count=0 way=0 public class BullCows { /** * 负责调用对应的方法,实现整个案例的逻辑关系 * * @p…… -
Encryption and decryption of Java strings
public static String encryptAndDencrypt(String value,char secret) { byte[] bt = value.getBytes(); // 将需要加密…… -
Nine palace grid memory network of Java project practice
Development background requirement analysis System objectives Functional structure System flow development environment…… -
Java collections classes: sort() ascending sort, reverse() descending sort, copy() copy, fill()
Forward sort Example 1 public class Test10 { public static void main(String[] args) { Scanner input = …… -
Hibernate isclosed method: judge whether the sessionfactory object is closed
isClosed() Example if(sessionFactory.isClosed()){ //判断SessionFactory对象是否关闭 System.out.println("SessionFa…… -
Struts 2 include tag: contains the page tag
Example <body> <h3>使用include标签包含jsp1.jsp</h3> <jsp:include page="jsp1.js…… -
JSP Response. Senderror() method: sends an error message to the client
sendError(int sc) Example <% response.sendError(404); %> -
Spring getbeansoftype method: get the JavaBean of the specified type
getBeansOfType(Class type) Example public static void main(String[] args){ ApplicationContext context = new Class…… -
Spring executefind method: callback query operation
executeFind(HibernateCallback action) Example public List getSmallUser(final Integer ID){ HibernateTemplate htm =…… -
Spring setpassword method: set the password to connect to the database
setPassword(String password) Example DriverManagerDataSource dmd = new DriverManagerDataSource(); dmd.setPassword(p…… -
Hibernate groupproperty method — sets the property column participating in the grouping
groupProperty(String propertyName) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criter…… -
Hibernate begintransaction method: start a transaction
beginTransaction() Example Transaction tx = null; //定义事务对象 try{ tx = session.beginTransaction(); //开启…… -
Spring execute method: callback execution
execute(HibernateCallback action) Example public TbUser getUser(final Integer ID){ HibernateTemplate htm = getHib…… -
JSP JSTL < C: when > tag: condition tag
< C: when test = "condition" >... Label body < / C: when > Example <%@taglib prefix="c" uri="http://j…… -
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 JSTL < FMT: bundle > tag: read binding message resources
body content Example <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> <fmt:bundle…… -
Spring setdriverclassname method: set the driver class of the data source
setDriverClassName(String driverClassName) Example public static void main(String[] args){ String driver = "com.M…… -
Struts 2 < action > element: establish the mapping of action objects
Syntax 1: url Example import com.opensymphony.xwork2.ActionSupport;/** *用户信息管理Action *@author …… -
Hibernate close method: close the sessionfactory object
close() Example sessionFactory = config.buildSessionFactory(); //创建SessionFactory对象 if(sessionFactory.isClosed…… -
How about your salary? What are the employment directions?
Web development Android Development Client development Game development -
Hibernate hibernate. max_ fetch_ Depth attribute: sets the grab depth
hibernate. max_ fetch_ Depth = attribute value Example <property name="hibernate.max_fetch_depth"> 1 </…… -
Struts 2 interceptor interface: interceptor
Syntax: public interface Interceptor extends Serializable{ void destroy(); void init(); String intercept(Ac…… -
Struts 2 basic configuration file
<struts> <!—设置常量的值--> <constant name="name" value="value"></constant> …… &…… -
Hibernate criteria interface setprojection method: sets the projection column of the query
setProjection(Projection projection) Example 1 Criteria criteria = session.createCriteria(UserForm.class); //示例化…… -
Struts 2 < include > element: contains other configuration files
Syntax: …….. < include file="file"/> Example <!DOCTYPE struts PUBLIC "-//Apache Software Foundatio…… -
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 ……