65. JDBC: the abbreviation of Java database connection technology, a specification for accessing databases in Java, is essentially an Object-Oriented Java API,
Function: establish a connection with the database, send SQL statements, and process the results returned by the database.
66. jdbc api: A group of applications designed for accessing the database in JavaProgramInterfaces are composed of a group of classes and interfaces written in Java, which can provide unified access for multiple relational databases.
67. java. SQL. there are three types of statement objects: Statement: execute simple SQL statements without parameters; preparedstatement: Execute pre-compiled SQL statements with or without the in parameter; callablestatement: executes the call to the stored procedure of the database.
68. general process of connecting to the database through JDBC:
① Load the JDBC Driver Class. forname ();
② Provide the URL for JDBC connection: Protocol: Sub-Protocol: data source identifier such as JDBC: sqlserver: // localhost:; datebasename = classdb.
③ Create a database connection:
④ Create a statement
⑤ Execute SQL statements
⑥ Processing result
7. Disable JDBC objects
69. encoding conversion method: Public String bytes (string Str ){
Try {
String str1 = STR;
Byte [] str2 = str1.getbytes ("ISO8859-1 ");
String strnew = new string (str2 );
Return strnew;
}
Catch (exception e ){}
Return NULL;
}
}
In request. getparamenters, pass this parameter to Str.
70. Javabean is a special Java class, which is actually a Java class for the purpose of implementation.Code. In MVC, it is mainly used to encapsulate transaction logic and database operations.
71. In short, JavaBean uses the software described in Java to build a model.
72. Purpose of using JavaBean: to reuse the designed program section
73. EJB: enterprise-level Javabean is the core of J2EE. It is a powerful building model used to create distributed applications, servers, and Java-based applications.
74. Javabean is mainly used to store status information, while EJB components can store business logic.
75. JavaBean features: 1. It is a common class and the constructor has no input parameters,
2. Attributes must be declared as private and methods must be declared as public,
3. Use a set method to set internal attributes, and use a set of get methods to obtain internal attributes,
4. It is a class without a primary method (but you can set the primary method to test the JavaBean function) and does not need to inherit the object class.
76. Use the <JSP: usebean>, <JSP: getproperty>, and <JSP: setproperty> actions in JSP to perform operations on JavaBean.
77. <JSP: usebean> basic syntax format: <JSP: usebean id = "beanname" Scope = "Page | request | session | application" class = "pagename. classname"/>
Note:
ID: Unique ID of a JavaBean object, representing an instance of a JavaBean object. A specific range exists. In the JSP page, the ID is used to represent the JavaBean.
Scope: represents the lifecycle of a JavaBean object.
Class: Specifies the Class Name of the JavaBean object. It must be case-insensitive.
78. <JSP: setproperty>: Set the attribute value of JavaBean. Format: <JSP: setproperty name = "beanname" last_syntax/>
Note:
Name: JavaBean instance defined by the <JSP: usebean> label
For more information about last_syntax, see references.
Param and value cannot be used at the same time.
79. <JSP: setproperty> obtain the property value of the JavaBean. Format: <JSP: setproperty name = "beanname" property = "propertyname">
Note:
Name: the JavaBean instance that wants to obtain the attribute value
Property: indicates the name of the property whose value is to be obtained.
80. servlet: a server-side Java application that can generate dynamic web pages. Serves as the intermediate layer for customer requests and server responses. Essentially, it is a Java class. The difference is that it can only run Java classes on the server side.
81. servlet lifecycle: when the server receives a Servlet request, it checks whether the servlet class exists. If the servlet class does not exist, it is created. If the servlet class exists, it is called directly. When multiple customers request a servlet, the server starts a thread for each user, which calls the servlet instance to respond to the customer request. When the server closes or detaches an application, it closes the servlet instance and releases the resources occupied by the servlet. This is a life cycle.
82. In servlet, The init () method is initialized only once during servlet loading, and the servlet is initialized, such as reading configuration information.
83. The service method in servlet is used to request the service. During the servlet lifecycle, the servlet will be called every time it is requested.
84. In servlet destroy (), when the server is closed, call the destroy method to release resources occupied by the servlet.
85. All servlets must directly or indirectly implement an interface. Generally, javax is not directly implemented. servlet. servlet, but extended to javax. servlet. genericservlet or javax. servlet. httpservlet to implement general Servlet and HTTP servlet.
86. If the form submission method is post, the corresponding dopost will be called in the servlet for processing. Otherwise, if the get method is used for submission, the servlet will call the corresponding doget method for processing.
87. JSP + JavaBean: JSP is responsible for displaying and controlling the logic. JavaBean: performs specific repeated operations.
88. JSP + servlet + JavaBean: JSP; display the presentation page. servlet: Process Control (complete a large number of transactions, act as the controller, and send requests to the customer. It is responsible for creating the JavaBean object required by JSP and deciding which JSP page to send to the user based on the request .) JavaBean: business logic processing
89. jstl: JSP standard tag library. Function: provides a standard and common tag library for JSP web developers. Use these tags to replace the Java code on the JSP page.
90. When using jstl, You need to copy the jstl. jar and standard. Jar files to the WEB-INF \ lib directory of the current project, and use the taglib command in the JSP file:
<% @ Taglib prefix = "C" uri = "http://java.sun.com/jsp/jstl/core" %>
91. El: Expression Language. All El expressions start with "$ {" and end with "}". constants, variables, and operations can be output in El.
92. variables that access a certain range in El can be used. or [], for example, $ {Param. userid} or $ {Param ["userid"]}.
93. Use the format of the defined function in El: NS: func (A1, a2...)
94. General labels of the jstl core tag Library: <C: Out> a JSP-like expression: calculates a result and outputs the result to the current jspwriter object. For more information, see related information.