Java
-
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 …… -
Online examination system for Java project practice (with source code and analysis)
Development background requirement analysis System objectives Functional structure System business process development…… -
Hibernate rowcount method: returns the number of records that meet the condition
rowCount() Example Criteria criteria = session.createCriteria(UserForm.class); //创建Criteria对象 criteria.add(Res…… -
Createcriteria method of Hibernate criteria interface: create a new criteria object
createCriteria(String associationPath) Example Session session = sessionFactory.openSession(); //获取session对象 C…… -
Hibernate close method: close the session object
close() Example Session session = sessionFactory.openSession(); //创建Session对象 if(session.isopen()){ //如果ses…… -
Spring execute method: callback execution
execute(HibernateCallback action) Example public TbUser getUser(final Integer ID){ HibernateTemplate htm = getHib…… -
Hibernate isnotnull method: judge whether it is not null
isNotNull(String propertyName) Example Criteria criteria = session.createCriteria(PersonForm.class); //创建Criteria…… -
Java operates generics through reflection
Generic and class classes public class ObjectFactory { public static Object getInstance(String clsName) { …… -
JSP JSTL < FMT: setbundle > tag: Specifies the message resource
Example <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> <fmt:setBundle basename="loca…… -
Execution order of finally and return in Java
1. Try and catch contain return public class tryDemo { public static int show() { try { r…… -
Spring getdriverclassname method: get the name of the database driver class
getDriverClassName() Example public static void main(String[] args){ String driver = "com.MysqL.jdbc.Driver"; …… -
Get annotation information through reflection
Example 1 /** * 这是自定义注解的类 */ @Target({ ElementType.TYPE,ElementType.METHOD }) @Retention(RetentionPolic…… -
JSP JSTL < x: param > tag: define parameters
parameter value Example <%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%> <%@taglib…… -
JSP Response. Setmaxinactivival() method: set the validity period of the session
setMaxInactiveInterval(int interval) Example <% session.setMaxInactiveInterval(30); %> -
Spring GetType method: get the type of JavaBean
getType(String name) Example public static void main(String[] args){ ApplicationContext context = new ClassPathXm…… -
JSP Response. Setdateheader() method: set the response header information
setDateHeader(String name,long date) Example <% long date = System.currentTimeMillis(); response.setDateHea…… -
Hibernate alleq method: set a series of equality conditions
Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria对象 Map map = new HashMap(); /…… -
Java 9 enhanced “diamond” syntax
List<String> strList = new ArrayList<String>(); Map<String,Integer> scores = new HashMap<Strin…… -
Logistics distribution system for Java project
Development background requirement analysis Necessity analysis System objectives System functional structure System de…… -
Hibernate query interface setboolean method: bind parameters with mapping type of Boolean
Grammar 1 setBoolean(int position,boolean val) Example String hql = "from UserForm where isDel=?"; //定义HQL语句 Q…… -
Hibernate opensession method: open a session
Grammar 1 openSession() Example SessionFactory sessionFactory = config.buildSessionFactory(); Session session = ses…… -
JSP JSTL < C: when > tag: condition tag
< C: when test = "condition" >... Label body < / C: when > Example <%@taglib prefix="c" uri="http://j…… -
JSP requestscope object: an implicit object that accesses the scope of the request
${requestScope.expression} Example ${requestScope.user} -
Hibernate createsqlquery method: creates an sqlQuery object
createsqlQuery(String queryString) Example Session session = sessionFactory.openSession(); //创建Session对象 Strin…… -
Hibernate setproperty method: specify the configuration property for the configuration object
setProperty(String propertyName,String value) Example 1 Configuration cfg = new Configuration() .setProperty("hib…… -
Spring xmlbeanfactory class: parsing spring configuration
Xmlbeanfactory(Resource resource) Example public static void main(String[] args){ Resource res = new ClassPathRes…… -
JSP JSTL < C: catch > tag: catch exception tag
< C: catch [var = "name"] >... Code with exception < / C: catch > Example <%@taglib prefix="c" uri="h…… -
Spring save method: saves the entity object
save(Object entity) Example public static void main(String[] args){ ApplicationContext context = new ClassPathXml…… -
JSP JSTL < SQL: setdatasource > tag: set data source
Example 1 <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%> 连接Sql Server 2000数据库 &…… -
Detailed explanation of Java if else statement
If statement syntax if ( 条件表达式) { 语句块; } Example 1 import java.util.Scanner; public class Test07 …… -
Springweb < form: input > tag: defines the text box input component of the form
Example <form:form> 用户名:<form:input maxlength="10" path="userName"/> <!--输入密码的文本框限…… -
Hibernate begin method: start transaction
begin() Example Transaction tx = session.getTransaction(); //创建Transaction示例 tx.begin(); //开启事务
