包含标签:Java 的文章
-
Spring drivermanagerdatasource class: Drive Manager data source
Grammar 1 DriverManagerDataSource() Example DriverManagerDataSource driverManagerDataSource = new DriverManagerDataS…… -
Spring getconnectionproperties method: get database connection properties
getConnectionProperties() Example public static void main(String[] args){ String driver = "com.MysqL.jdbc.Driver"…… -
Java RandomAccessFile class: dynamic reading of file contents
Example 1 public class RandomAccessFileDemo { public static void main(String[] args) { try { …… -
Implementation of java example air ticket discount in low and peak seasons
Use if else statement to realize air ticket discount in low and peak seasons public static void main(String[] args) …… -
Java interface: definition and implementation of interface, definition and implementation of interface
Define interface public interface A { publicA(){…} // 编译出错,接口不允许定义构造方法 } public interface…… -
Spring batchupdate method: execute batch update statement
batchUpdate(String[] sql) Example public static void main(String[] args){ ApplicationContext context = new ClassP…… -
JSP Request. Getsession () method: get the session object related to the request
getSession(boolean create) Example <% HttpSession ses = request.getSession(true); out.println("客户端sessio…… -
JSP JSTL < x: param > tag: define parameters
parameter value Example <%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%> <%@taglib…… -
JSP JSTL < SQL: setdatasource > tag: set data source
Example 1 <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%> 连接Sql Server 2000数据库 &…… -
JSP header object: get a specific header value of HTTP request
${header.expression} Example ${header.host} ${header[host]} -
Hibernate hibernate. transaction. factory_ Class attribute: sets the transaction management type
hibernate. transaction. factory_ Class = attribute value Example <property name="hibernate.transaction.factory_cl…… -
Struts2 ActionContext. Getcontext () method: get actioncontext object
public static ActionContext getContext() Example //获取ActionContext对象 ActionContext context = ActionContext.getC…… -
Hibernate between method: set the condition between the two
between(String propertyName,Object lo,Object hi) Example Criteria criteria = session.createCriteria(UserForm.class);…… -
JSP initparam object: get the value of the initialization parameter of the web application
${initParam.expression} Example <context-param> <param-name>author</param-name> <param-va…… -
Hibernate buildsessionfactory method: build sessionfactory
buildSessionFactory() Example Configuration config = new Configuration().configure(); //创建Configuration对象 Sess…… -
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…… -
Hibernate createquery method: creates a query object
createQuery(String queryString) Example Session session = sessionFactory.openSession(); //定义Session对象 String h…… -
Java package: Java system package and custom package
System package Custom package 1. Declaration of package package 包名; 2. Use of package example.Test test = new ex…… -
Java imitation landlords shuffle licensing games
public class Main { public static void main(String[] args) { // 1. 准备牌 String[] arr1 = { "…… -
Hibernate addscalar method: returns a combination of scalar and entity
addScalar(String columnAlias,Type type) Example String sql = "select avg(result.english)as avgEnglish from tb_result…… -
JSP cookie object: access the cookie name set by the request
${cookie expression} Example <%Cookie cookie = new Cookie("user","zs"); response.addCookie(cookie); %> …… -
-
JSP Response. Setmaxinactivival() method: set the validity period of the session
setMaxInactiveInterval(int interval) Example <% session.setMaxInactiveInterval(30); %> -
Detailed explanation of Java if else statement
If statement syntax if ( 条件表达式) { 语句块; } Example 1 import java.util.Scanner; public class Test07 …… -
JSP Response. Getcreationtime () method: get the time when the session object was created
getCreationTime() Example <% session.setAttribute("user","zs"); long timenum = session.getCreationTime(); …… -
Hibernate or method: logic or operation
or(Criterion lhs,Criterion rhs) Example Criteria criteria = session.createCriteria(PersonForm.class); //定义Criteri…… -
Spring geturl method: get the URL path to access the database
getUrl() Example public static void main(String[]args){ String driver = "com.MysqL.jdbc.Driver"; String url = …… -
JSP Response. Getservletcontext() method: returns the ServletContext object to which the session belongs
getServletContext() Example <% ServletContext sc = session.getServletContext(); %> -
Hibernate GT method: set greater than condition
gt(String propertyName,Object value) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Crit…… -
Deep analysis of Java synchronized implementation principle
Implementation principle of Java synchronized public class SynchronizedTest { public synchronized void test1(){…… -
Hibernate ID method: projection object identifier
id() Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria对象 criteria.setProjection…… -
The difference between dynamic web pages and static web pages
Static web page Dynamic web page Advanced