Java learning log 05

xiaoxiao2021-03-06  68

November 16, 2004 ------------------- First, develop a message (decided to use JSP servlet development, refer to the school's message) Development Steps: 1.1 Creating Database 1.2 Write Connection Database Class 1.3 Write Message Class 1.4 Implementation Message Function 1.5 Message Operation Class (Edited, Delete) 1.6 Realization Message Operation November 17, 2004 ---------------- ---- First, write a message 1, implement the data read data by the servlet through the link and web.xml // Basically, the content of the review teacher 2, servlet is implemented by inheriting javax.servlet.httpservlet class ----- --------------- November 18, 2004 ------------------- First, how to study how to be from the library Reading data 1.1 Walking through the Radewalk 1.1.1 Vector v = null; //wrong vector v = new vector (); // Right 1.1.2 Read implementation process: conn.class // passed JDBC -odbc bridge, realize the connection of the database GBTable.class // implement the format output with the GET and SET methods, enter the data readgb.class //, use the ListInfo method, write database data through the SET method in GBTABLE, each Record write once. // Return Vector.Elements (), type Enumeration. 1.1.3 How to read data readgb re = new readGB () from VECTOR (); enumeration list = re.listinfo (); while (list.hasmorelements )) {GBTABLE LISTGB = (GBTABLE) list (); system.out.println (listgb.getid ());} 1.1.4 Index.jsp Reads Data <% ReadGB List = New ReadGB (); ENUMERATION RS = list.listinfo (); while (rs.hasmorelements ()) {GBTABLE LISTINFO = (G btable) rs.nextelement ();%> <% =

Listinfo.getuname ()%> // Realization from the data one record summary: I have passed some detours, or try it in JCREATOR, if you put it directly in the JSP file, the error report will make people two Research on how to write to the database 1.1 Writegb.java This servlet class has been written, and now how to read the client IP has no idea. // 20: 37 2004-11-18 Go to swim. 1.2 Req.SetCharacterencoding ("GBK"); // Format the Chinese input, otherwise it is garbled 1.3 Date newDate = new date (); string = newdate.tolocalestring (); // Get the current time and 2004-11-19 0:20 Format Get 1.4 string uip = req.getRemoteAddr (); // Get Client IP

转载请注明原文地址:https://www.9cbs.com/read-89737.html

New Post(0)