What are the most basic data types? 3 INT and Integer What is the difference between 4 string and StringBuffer? Is there a difference in the runtime? An abnormality indicates the abnormal state of the program during operation, and the runtime exception indicates an exception that may be encountered in the usual operation of the virtual machine is a common run error. The Java compiler requires that the method must declare that the possible non-running abnormality, but does not require a statement that the abnormality that is not captured. 6 Speak some common class, package, interface, please raise 5 7 to say that ArrayList, Vector, LinkedList's storage performance and features ArrayList and Vector are stored in an array mode, and the number of elements is greater than the actual stored data. In order to increase and insert elements, they all allow direct sequence number index elements, but inserted into memory operations such as array elements, so the index data is fast and the data is slow, and the vector is used by the Synchronized method (thread security), usually Compared to ArrayList, the LinkedList uses a two-way linked list to store, pressing the number index data to perform forward or rear traversal, but only the front and rear items of this item are required when inserting data, so the insertion speed is faster. 8 Design 4 threads, two threads increase 1 each time, and two threads are reduced each time. Write the program. The following procedure uses internal classes to implement threads, and no order issues are not considered when J is reduced. Public class threadtest1 {private int j; public static void main (string args []) {threadtest1 tt = new threadtest1 (); incin = tt.new inc (); DEC = tt.new dec (); for (int i = 0; i <2; i ) {thread t = new thread (inc); t.start (); t = new thread (dec); t.start ();}} private synchronized void inc () {J System.out.Println (Thread.currentThread (). Getname () "- inc:" J);} private synchronized void dec () {j -; system.out.println (thread.currentthread (). GetName () "- DEC:" J);} Class incmplements Runnable {public void run () {for (int i = 0; i <100; i ) {inc ();}}} Class Dec Implements Runnable {PUBLIC VOID RUN () {for (INT i = 0; i <100; i ) {dec ();}}}} 9. The built-in object and method of JSP. Request Request represents the HTTPServletRequest object. It contains information about the browser request and provides a number of methods for obtaining cookie, header, and session data.
Response Response represents the HTTPServletResponse object and provides several methods for setting the response to the browser (such as cookies, header information, etc.) OUT OUT objects are an instance of javax.jsp.jspwriter, and provide several ways You can use to return the output results to your browser.
PageContext PageContext represents a javax.servlet.jsp.pageContext object. It is an API for convenient access to various range spaces, servlet-related objects, and wraps a generic Servlet related feature.
Session session represents a request Javax.Servlet.http.httpsession object. SESSION can store the status information of the user
Application Applicat Indicates a Javax.Servle.ServletContext object. This helps find information about the Servlet engine and the servlet environment
Config config represents a javax.servlet.ServletConfig object. This object is used to access the initialization parameters of the servlet instance.
Page Page Represents a servlet instance 10 generated from this page. Writing communication with the Socket communication, requiring the customer to return the same data after sending data. See the Socket Communication in the course. 11 Say the life cycle of the servlet and say the difference between servlet and CGI. After the servlet is instantiated by the server, the container runs its init method, the request is reached, the service method is automatically dispatched with the DOXXX method (Doget, DOPOST) corresponding to the request, and calls its Destroy when the server decides to destroy the instance. method. The difference from the CGI is that the servlet is in the server process, which runs its service method by multithreading, and an instance can serve multiple requests, and its instance is generally not destroyed, and CGI has a new process for each request. After the service is completed, it is destroyed, so it is less efficient than servlet. 12.EJB is based on which technologies are implemented? And say the difference between SessionBean and EntityBean, the differences of Statefulbean and STATELESSBEAN.
13. EJB includes (sessionbean, entitybean) says their life cycle, how to manage transactions?
14. What is the working mechanism of the data connection pool?
15 Synchronous and asynchronous and asynchronous, use them in what circumstances? for example.
16 What are the application servers?
17 What are your collections you know? Main method?
18 Give you: Driver A, Data Source Name B, the user name is C, the password is D, the database table is T. All the data of the table T is retrieved with JDBC.
19. Say how to make a pagination in the JSP page? Page needs to save the following parameters: Total line number: get the number of lines per page according to the SQL statement: Set value Current page: Request parameter page According to the current number of pages and each page The number calculates the number of lines of the first line of the current page. The positioning result set is set to this line, and the result set takes out the line of the number of rows per page.
Database:
1. Different storage procedures for stored procedures and functions are a collection of user-defined series of SQL statements, involving tasks for specific tables or other objects, users can call stored procedures, and functions are usually the customized method, which receives parameters and Returns a certain type of value and does not involve a specific user table. 2. What is the transaction? The transaction is a series of operations performed as a logical unit, and a logical work unit must have four attributes, called ACID (atomic, consistency, isolation, and persistent) attributes, only this can become a transaction: atomic transaction It must be an atomic work unit; for its data modification, it is either executed, or all do not execute. When the consistency is completed, all the data must be consistent. In the relevant database, all rules must be used to modify the transaction to maintain all data integrity. At the end of the transaction, all internal data structures (such as B tree indexes or bidirectional linies) must be correct. Isolation is modified by concurrent affairs to be isolated from any other concurrent business. Transaction View the status of data when data is displayed, or another concurrent transaction modifies its previous state, or another transaction modifies the state after it, the transaction does not view the data of the intermediate state. This is referred to as serialization because it can reload the starting data and replay a series of transactions so that the status at the end of the data is the same as the original transaction. After the durability transaction is completed, its impact on the system is permanent. This modification will remain maintained even if there is a system failure. 3. The role of the cursor? How do you know that the cursor has arrived at the end? The cursor is used for the line of positioning result set, and by judging that the global variable @@ fetch_status can determine whether the final change is usually, this variable is usually not equal to 0 to indicate an error or finally. 4. The trigger is divided into an existing trigger and post-event trigger, which triggers and distinctions. What is the difference between statement level trigger and row trigger. The prior trigger is running before the trigger event occurs, and after the event is running after the trigger event occurs. Usually the prior trigger can get the event before and the new field value. Statement-level triggers can be executed before or after execution of statements, while the row triggers each row that triggered in the trigger.
COLVETION Test 1, object-oriented three basic feature 2, method overload and method rewriting concept and distinction 3, interface and internal class, abstract class characteristics 4, file read and write basic class ** 5, serial Precautions and how to achieve serialization 6, thread basic concept, thread's basic state, and state between the relationship 7, the synchronization of the thread, how to achieve thread synchronization 8, several common data structures and internal implementation principles . 9, Socket Communication (TCP, UDP Difference, Java Implementation) ** 10, Java Event Principal Mechanism and Garbage Recycling Mechanism 11, JDBC Call Database Basic Step ** 12 Java definition 14, Java Internationalization II, JSP1, at least 7 implied objects and their distinction ** 2, Forward and Redirect 3, JSP common instructions, servlet1, Call Doget () and dopost () in what situation? 2, servlet's init () method and service () method distinguish 3, the lifecycle of servlet 4, how realistic servlet single-thread mode 5, Servlet configuration 6, four session tracking technology four, EJB ** 1, EJB The services provided by the container primarily provide services such as declaration cycle management, code generation, continuous management, security, transaction management, lock and distribution management. 2, EJB role and three object EJB roles mainly include the Bean Developer Application Assessor Deployer System Administrator EJB Container Provider EJB Server Provider's three objects are Remote (local (localhome) interface, Bean class 2. Several types of sessions of EJB (session) bean, entity (Entity) bean-based bean can be divided into stateful and stateless, both entity beans can be divided into Two kinds of sustainability (BMP) and container management continuity (CMP)
3, the lifecycle of the bean instance For the STATELESS SESSION bean, the Entity Bean, the Message Driven bean generally has buffer pool management, and there is a cache management of the Entity Bean and Statefull Session Bean, which typically contains an instance, set the context, create EJB Object (Create) , Business methods call, remove, etc. For beans with buffer pool management, after CREATE, the instance does not remove from memory, but use buffer pool scheduling mechanisms to continuously reuse instances, and beans for Cache management, by activation and go The activation mechanism maintains the state of the bean and limits the number of instances in the memory. 4, the activation mechanism is in the STATEFULL SESSION bean as an example: its Cache size determines the number of bean instances that can be present in the memory, according to the MRU or NRU algorithm, the instance is migrated between activation and deactivation state, the activation mechanism is when the client When you call an EJB instance business method, if you do not bind the corresponding bean instance you don't bind the corresponding bean (by serializing mechanism storage instance) Reply (activation) this instance. The corresponding EJBACTIVE and EJBPASSIVATE methods are called before the state change. 5, the REMOTE interface and the home interface main REMOTE interface defines the business method. The HOME interface is used for EJB client calling business method HOME interface is an EJB factory for creating and removing the EJB instance 6. Several basic steps for the customer service call EJB object First, set the JNDI service factory and the JNDI service address system attribute, find the Home interface, call the CREATE method from the Home interface, create the Remote interface, call its business method 5, database 1, store procedure 2, basic SQL statement six, weblogic1, how to specify the size of the size to WebLogic? In the start of WebLogic script (bitservername in the Domian corresponding server directory), add SET MEM_ARGS = -XMS32M -XMX200M, can adjust the minimum memory 32m, max 200M2 How to set WebLogic hot start mode (development mode) and product release mode? You can modify the startup mode of the corresponding server as one of the development or product modes in the management console. Or modify the service startup file or Comufact of the Commenv file, add set production_mode = true. 3. Do you need to enter a username and password when starting? Modify the service startup file, add WLS_USER and WLS_PW items. You can also add an encrypted username and password in the boot.properties file. 4. After the WebLogic Management Table is configured to configure a application domain (or a website, Domain), and What file is actually saved? Save in this Domain's config.xml file, it is the core configuration file of the server. 5. Talk about the default directory structure of a Domain in WebLogic? For example, put a simple helloWorld.jsp into the why directory, but you can be http: // host on the browser: port number // HelloWord .jsp You can see the results of the run? Application, the application directory needs to meet the web application directory requirements, the JSP file can be placed directly in the application directory, JavaBean needs to be placed in the CLASSES directory of the application directory, setting the server's default application will be implemented on the browser No need to enter an app name.