Java
-
Springweb < form: input > tag: defines the text box input component of the form
Example <form:form> 用户名:<form:input maxlength="10" path="userName"/> <!--输入密码的文本框限…… -
Java digital to RMB reading method (with source code and analysis)
More than 12 will not be considered for the time being. import java.util.Arrays; import java.util.Scanner; publi…… -
Spring GetPassword method: get the password of the database
getpassword() Example public static void main(String[] args){ String driver = "com.MysqL.jdbc.Driver"; String …… -
Spring setusername method: set the user name to access the database
setUsername(String username) Example DriverManagerDataSource dmd = new DriverManagerDataSource(); dmd.setUsername("…… -
Hibernate count method: returns the number of attributes
count(String propertyName) Example Criteria criteria = session.createCriteria(UserForm.class); //定义Criteria对象 …… -
Hibernate close method: close the sessionfactory object
close() Example sessionFactory = config.buildSessionFactory(); //创建SessionFactory对象 if(sessionFactory.isClosed…… -
Hibernate wasrolledback method: judge whether the transaction is rolled back
wasRolledBack() Example try{ tx = session.beginTransaction(); //开启事务 UserForm uf = new UserForm(); //定…… -
Java final modifier: final modifier attribute, final modifier method and final modifier class
1. Final modifies the attributes in the class 2. Methods in final modifier class 3. Final modifier class Example 1 p…… -
Hibernate criteria interface list method: returns a list collection
list() Example Session session = sessionFactory.openSession(); //获取session对象 List list = null; try{ Criter…… -
Java object type conversion and forced object type conversion
Example 1 Animal:动物 Animal:可爱的动物 Cat:吃饭 Animal:动物在吃饭 Cat:可爱的小猫 Cat:猫喜欢吃鱼 Force ob…… -
Hibernate query interface setparameter method: bind parameters of any type
setParameter(String name,Object val) Example String hql = "from UserForm where username=:userName"; //定义查询HQL语…… -
Spring getBean method: get the JavaBean in the container
Grammar 1 getBean(String name) Example public static void main(String[] args){ ApplicationContext context = new C…… -
Hibernate connection. driver_ Class attribute — specifies the database driver
hibernate. connection. driver_ Class = attribute value Example 1 <property name="hibernate.connection.driver_clas…… -
JSP Response. Setdateheader() method: set the response header information
setDateHeader(String name,long date) Example <% long date = System.currentTimeMillis(); response.setDateHea…… -
Hibernate begin method: start transaction
begin() Example Transaction tx = session.getTransaction(); //创建Transaction示例 tx.begin(); //开启事务 -
-
Hibernate addentity method: Associate alias with entity class
Grammar 1 addEntity(Class entityClass) Example Session session = sessionFactory.openSession(); //定义Sesssion对象 …… -
Hibernate query interface setDate method: bind parameters with mapping type of date
Grammar 1 setDate(int position,Date date) Example String hql = "from UserForm where birthday=?"; //定义查询HQL语句 …… -
Baidu know website development of Java project
Development background requirement analysis feasibility study System objectives System functional structure System flo…… -
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…… -
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…… -
JSP Response. Setcontenttype() method: sets the MIME type of the response object
setContentType(String type) Example <% response.setContentType("video/x-msvideo"); %> -
Hibernate cache. use_ second_ level_ Cache attribute: determines whether to close the L2 cache
hibernate. cache. use_ second_ level_ Cache = attribute value Example <property name="hibernate.cache.use_second_…… -
Differences between Java interfaces and abstract classes
Basic grammatical differences public interface Animal { // 所有动物都会吃 public void eat(); // 所…… -
Hibernate addclass method: load entity class
addClass(Class persistentClass) Example Configuration config = new Configuration(); //创建Configuration对象 Config…… -
Hibernate criteria interface setfirsresult method: sets the starting point of the result set
setFirstResult(int firstResult) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria…… -
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 …… -
Hibernate alleq method: set a series of equality conditions
Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria对象 Map map = new HashMap(); /…… -
Hibernate like method: set the condition of fuzzy query
like(String propertyName,Object value) Example 1 Criteria criteria = session.createCriteria(UserForm.class); //创建…… -
Hibernate AVG method: calculate the average value of a column
avg(String propertyName) Example Criteria criteria = session.createCriteria(ResultForm.class); //定义Criteria对象 …… -
JSP Response. Isnew() method: judge whether the current user is a new user
isNew() Example <% out.print(session.isNew()); %> -
Setmaxresults method of Hibernate criteria interface: set the maximum number of returned records
setMaxResults(int maxResults) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria示……