Recent Posts
-
Hibernate configuration properties
<?xml version='1.0'encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Co…… -
Hibernate show_ SQL attribute: Specifies whether to output SQL statements
hibernate. show_ SQL = attribute value Example <property name="hibernate.show_sql"> true </property>…… -
Basic elements of Java programs
identifier keyword notes import java.applet.*; //导入java.applet包下的所有类 import java.awt.*; //导入java.a…… -
JSP JSTL < x: choose > tag: complete condition judgment
body content( and subtags) Example <%@taglib prefix="x" uri="http://java.sun.com/jsp…… -
Hibernate like method: set the condition of fuzzy query
like(String propertyName,Object value) Example 1 Criteria criteria = session.createCriteria(UserForm.class); //创建…… -
Hibernate begin method: start transaction
begin() Example Transaction tx = session.getTransaction(); //创建Transaction示例 tx.begin(); //开启事务 -
Springweb < form: input > tag: defines the text box input component of the form
Example <form:form> 用户名:<form:input maxlength="10" path="userName"/> <!--输入密码的文本框限…… -
Detailed explanation of Java if else statement
If statement syntax if ( 条件表达式) { 语句块; } Example 1 import java.util.Scanner; public class Test07 …… -
JSP JSTL < SQL: setdatasource > tag: set data source
Example 1 <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%> 连接Sql Server 2000数据库 &…… -
Spring save method: saves the entity object
save(Object entity) Example public static void main(String[] args){ ApplicationContext context = new ClassPathXml…… -
JSP JSTL < C: catch > tag: catch exception tag
< C: catch [var = "name"] >... Code with exception < / C: catch > Example <%@taglib prefix="c" uri="h…… -
Spring xmlbeanfactory class: parsing spring configuration
Xmlbeanfactory(Resource resource) Example public static void main(String[] args){ Resource res = new ClassPathRes…… -
Hibernate setproperty method: specify the configuration property for the configuration object
setProperty(String propertyName,String value) Example 1 Configuration cfg = new Configuration() .setProperty("hib…… -
Hibernate createsqlquery method: creates an sqlQuery object
createsqlQuery(String queryString) Example Session session = sessionFactory.openSession(); //创建Session对象 Strin…… -
JSP requestscope object: an implicit object that accesses the scope of the request
${requestScope.expression} Example ${requestScope.user} -
JSP JSTL < C: when > tag: condition tag
< C: when test = "condition" >... Label body < / C: when > Example <%@taglib prefix="c" uri="http://j…… -
Hibernate opensession method: open a session
Grammar 1 openSession() Example SessionFactory sessionFactory = config.buildSessionFactory(); Session session = ses…… -
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…… -
Logistics distribution system for Java project
Development background requirement analysis Necessity analysis System objectives System functional structure System de…… -
Java 9 enhanced “diamond” syntax
List<String> strList = new ArrayList<String>(); Map<String,Integer> scores = new HashMap<Strin…… -
Hibernate alleq method: set a series of equality conditions
Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria对象 Map map = new HashMap(); /…… -
JSP Response. Setdateheader() method: set the response header information
setDateHeader(String name,long date) Example <% long date = System.currentTimeMillis(); response.setDateHea…… -
Spring GetType method: get the type of JavaBean
getType(String name) Example public static void main(String[] args){ ApplicationContext context = new ClassPathXm…… -
JSP Response. Setmaxinactivival() method: set the validity period of the session
setMaxInactiveInterval(int interval) Example <% session.setMaxInactiveInterval(30); %> -
JSP JSTL < x: param > tag: define parameters
parameter value Example <%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%> <%@taglib…… -
Get annotation information through reflection
Example 1 /** * 这是自定义注解的类 */ @Target({ ElementType.TYPE,ElementType.METHOD }) @Retention(RetentionPolic…… -
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"; …… -
Execution order of finally and return in Java
1. Try and catch contain return public class tryDemo { public static int show() { try { r…… -
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…… -
Java operates generics through reflection
Generic and class classes public class ObjectFactory { public static Object getInstance(String clsName) { …… -
Hibernate isnotnull method: judge whether it is not null
isNotNull(String propertyName) Example Criteria criteria = session.createCriteria(PersonForm.class); //创建Criteria…… -
Spring execute method: callback execution
execute(HibernateCallback action) Example public TbUser getUser(final Integer ID){ HibernateTemplate htm = getHib……