Recent Posts
-
Detailed explanation of Java break statement
Terminate a sequence of statements in a switch statement Use the break statement to forcibly exit the loop directly Ex…… -
Java judges leap year and average year and outputs the number of days of a month
import java.util.Scanner; public class Test27 { public static void main(String[] args) { // 在这里编…… -
Struts 2 set tag: defines a variable
Example <body> <!--将表达式user.username的值保存在默认范围中,即action范围--> <s:set name="…… -
Hibernate query interface setdouble method: bind parameters with mapping type of double
Grammar 1 setDouble(int position,double val) Example String hql = "from GoodsForm where price=?"; //定义查询HQL语句…… -
Verifying IP addresses with Java regular expressions
\d{1,3}\.\d{1,3} import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; publ…… -
Hibernate wasrolledback method: judge whether the transaction is rolled back
wasRolledBack() Example try{ tx = session.beginTransaction(); //开启事务 UserForm uf = new UserForm(); //定…… -
Hibernate ID method: projection object identifier
id() Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria对象 criteria.setProjection…… -
Springweb < form: Select > tag: defines a drop-down selection box or a list selection box
Example public class NewBean{ private List fanList; private String date; public String getDate(){ ret…… -
Spring drivermanagerdatasource class: Drive Manager data source
Grammar 1 DriverManagerDataSource() Example DriverManagerDataSource driverManagerDataSource = new DriverManagerDataS…… -
JSP JSTL < C: fortokens > tag: output tag by iterating the string
< C: fortokens items = "string" delims = "char" [var = "name"] [begin = "start"] [end = "end"] [Step = "len"] [vars…… -
JSP JSTL < SQL: update > tag: update data
Syntax: The syntax of the query statement is as follows: actions The syntax of conditional query is a…… -
Does java have multidimensional arrays?
type[][] arrName; arrName = new type[length][] public class TwoDimensionTest { public static void main(String[]…… -
Struts2 ServletActionContext. Getrequest () method: get HttpServletRequest object
public static HttpServletRequest getRequest() Example //获取HttpServletRequest对象 HttpServletRequest request = Ser…… -
Spring getbeannamesfortype method: get bean name by type
getBeanNamesForType(Class type) Example public static void main(String[] args){ ApplicationContext context = new…… -
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 include tag: contains the page tag
Example <body> <h3>使用include标签包含jsp1.jsp</h3> <jsp:include page="jsp1.js…… -
Struts2 ActionContext. getContext(). Get (object key) method: get the request of map type
public Object get(Object key) Map request = ActionContex.getContext.get("request"); @H_404_7@ 说明:ActionContext …… -
Setstring method of Hibernate query interface: bind parameters with mapping type of string
Grammar 1 setString(int position,String val) Example String hql = "from UserForm where sex=?"; //定义查询HQL语句 Q…… -
Hibernate hibernate. use_ sql_ Comments attribute: Specifies whether to output comment information
hibernate. use_ sql_ Comments = attribute value Example <property name="hibernate.use_sql_comments"> true …… -
Spring update method: updates the specified entity object
update(Object entity) Example public static void main(String[] args){ ApplicationContext context = new ClassPathX…… -
Hibernate connection. URL property: Specifies the URL to connect to the database
hibernate. connection. Url = attribute value Example 1 <property name="hibernate.connection.url"> jdbc:micr…… -
Hibernate close method: close the sessionfactory object
close() Example sessionFactory = config.buildSessionFactory(); //创建SessionFactory对象 if(sessionFactory.isClosed…… -
Deep analysis of Java synchronized implementation principle
Implementation principle of Java synchronized public class SynchronizedTest { public synchronized void test1(){…… -
Hibernate buildsessionfactory method: build sessionfactory
buildSessionFactory() Example Configuration config = new Configuration().configure(); //创建Configuration对象 Sess…… -
Struts2 ActionContext. Getapplication () method: get the application object of map type
public Map getApplication() Example Typical application Info value in the request range: Info value in the session ran…… -
JSP Response. Setattibute() method: sets the attribute value of the specified name
setAttribute(String name,Object value) Example <% session.setAttribute("information","向session中保存数据"); …… -
Hibernate Ge method: set the condition greater than or equal to
ge(String propertyName,Object value) Example Criteria criteria = session.createCriteria(UserForm.class); //创建Crit…… -
Hibernate contains method: judge whether the object exists in the cache
contains(Object object) Example if(session.contains(uf)){ //判断示例对象uf是否在缓存中 System.out.println("uf在…… -
Java perfects the error message of division operation
public class Compute { private int[] num = new int[2]; public int[] getNum() { return num; }…… -
Why use up transformation instead of directly creating subclass objects?
Example 1 public class Animal { public void sleep() { System.out.println("小动物在睡觉"); } …… -
How about your salary? What are the employment directions?
Web development Android Development Client development Game development -
Hibernate isclosed method: judge whether the sessionfactory object is closed
isClosed() Example if(sessionFactory.isClosed()){ //判断SessionFactory对象是否关闭 System.out.println("SessionFa……