包含标签:Java 的文章
-
Setmaxresults method of Hibernate query interface: set the maximum number of returned records
setMaxResults(int maxResults) Example Session session = sessionFactory.openSession(conn); //获取session对象 String…… -
Createalias method of Hibernate criteria interface: establish connection query
Grammar 1 createAlias(String associationPath,String alias) Example Session session = sessionFactory.openSession(); …… -
JSP JSTL < SQL: param > tag: specify SQL parameters
parameter value Example <%@page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%&…… -
Hibernate query interface list method: returns the list collection of query results
list() Example Session session = sessionFactory.openSession(); //获取session对象 String hql = "from UserForm"; //…… -
Java uses internal classes to implement multiple inheritance
Example 1 public class Father { public int strong() { // 强壮指数 return 9; } } pu…… -
Java operates generics through reflection
Generic and class classes public class ObjectFactory { public static Object getInstance(String clsName) { …… -
Hibernate createsqlquery method: creates an sqlQuery object
createsqlQuery(String queryString) Example Session session = sessionFactory.openSession(); //创建Session对象 Strin…… -
-
Struts 2 iterator tag: tag of iterative data
< s: iterator value = "collection element" id = "ID number" status = "instance name" > < s: property / > &…… -
Java computing GPA
import java.util.InputMismatchException; import java.util.Scanner; public class Test03 { public static void…… -
Java StringBuffer replaces special characters
import java.util.Scanner; public class test2 { public static void main(String[] args) { System.out.…… -
Hibernate default_ entity_ Mode attribute: Specifies the default entity representation mode
hibernate. default_ entity_ Mode = attribute value Example <property name="hibernate.default_entity_mode"> …… -
Java perfects the error message of division operation
public class Compute { private int[] num = new int[2]; public int[] getNum() { return num; }…… -
Struts2 ServletActionContext. Getrequest () method: get HttpServletRequest object
public static HttpServletRequest getRequest() Example //获取HttpServletRequest对象 HttpServletRequest request = Ser…… -
What about Java null objects?
Student stu = new Student(); // Statement 1 student stu2// Statement 2 stu2 = new student()// Statement 3 String str1=…… -
How Java creates projects
Example 1 public class HelloJava { public static void main(String[] args) { //TODO自动生成的方法…… -
Hibernate rollback method: rollback transaction
rollback() Example Transaction tx = null; try{ Session session = sessionFactory.openSession(); //定义Session…… -
Hibernate commit method: commit transaction
翻译错误 Invalid Access Limit Example Session session = sessionFactory.openSession(); //定义Session对象 Transactio…… -
Hibernate isnull method: judge whether it is null
isNull(String propertyName) Example Criteria criteria = session.createCriteria(PersonForm.class); //创建Criteria对…… -
Struts2 ServletActionContext. Getresponse () method: get httpservletresponse object
public static HttpServletResponse getResponse() Example //获取HttpServletResponse对象 HttpServletResponse response …… -
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…… -
Hibernate setproperty method: specify the configuration property for the configuration object
setProperty(String propertyName,String value) Example 1 Configuration cfg = new Configuration() .setProperty("hib…… -
JSP JSTL < FMT: Message > tag: reading local messages
Grammar 1 Grammar 2 subtags Example <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt…… -
Hibernate generate_ Statistics property: collect statistics
hibernate. generate_ Statistics = attribute value Example <property name="hibernate.generate_statistics"> t…… -
Detailed explanation of Java object class: common methods of object class (equals() and getclass())
public class MyClass{…} public class MyClass extends Object {…} Equals() method boolean result = obj.equals(Obje…… -
Hibernate distinct method: set the uniqueness of query results
distinct(Projection proj) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria对象 c…… -
Java Gobang game (with source code and analysis)
import java.util.Scanner; public class Gobang { // 定义棋盘的大小 public static int BOARD_SIZE = 15; …… -
Hibernate contains method: judge whether the object exists in the cache
contains(Object object) Example if(session.contains(uf)){ //判断示例对象uf是否在缓存中 System.out.println("uf在…… -
Does java have multidimensional arrays?
type[][] arrName; arrName = new type[length][] public class TwoDimensionTest { public static void main(String[]…… -
Hibernate and method: logic and operation
and(Criterion lhs,Criterion rhs) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria…… -
JSP pagecontext object: access JSP built-in objects
${PageContext.request[expression]} Example ${PageContext.session.username} -
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(){ /……