knock on the keyboard, will not use any mode, write out the code only he can understand. Make the software is also fragmented, do a little change to have a lot of trouble, and you do not know what will happen after the changes, the feeling of living in a dangerous house.
Here's an example of a misuse pattern. I have been involved in a large group of the second phase of OA system development, the development of the original code architecture and ad
In general, the factory model is divided into 3 types, simple Factory mode, factory method mode, abstract Factory mode. These three kinds of factory models go deep in layers.One, from the Springweb.jar package using an example of
In general, the factory model is divided into 3 types, simple Factory mode, factory method mode, abstract Factory mode. These three kinds of factory models go deep in layers.one, from the Springweb.jar package using an example of
90% of the time to press the keyboard, I will not use any mode. The code written can only be understood by myself. The software is also fragmented, and it will take a long time to make any changes, and you do not know what problems will occur after the changes, so you will feel like living in a dangerous room. Here is an example of misuse. I have participated in Phase II development of the OA system of a large group company. I have developed and used
Patterns-factory methods-abstract factories;public class MSIK7N2G implements mainboard{public void Attach (CPU CPU) throws exception{if (Cpu.getclass (). toString (). EndsWith ("AMD")) {System.out.println ("msik7n2g");}else{throw new Exception ("Motherboard msik7n2g only with AMD CPU");}}}
Package com.yq1012. Creating Patterns-factory methods-abstract factories;
Public class Test { public static voi
js|mysql| Page One, preface
In fact, the rewritten JDBC Data-source is run in the servlet, looking for a data source through Jndi. I use the Orion trial, the site of the "Java/jsp Learning series of six (MySQL page example)," a simple rewrite.
Second, the configuration
(1) Jdbc
Need to use JDBC driver copy to [Orio
First, the preface
In fact, the rewritten JDBC Data-source is run in the servlet, looking for a data source through Jndi. I use the Orion trial, the site of the "Java/jsp Learning series of six (MySQL page example)," a simple rewrite.
Second, the configuration
(1) Jdbc
Need to use JDBC driver copy to [Orion]/lib directory
(2) Data-source
Add the following i
Colleagues use Java to do a crawl of any page title, because the HTML of any page in the head of the meta-specified charset a variety of, such as commonly used utf-8,gbk,gb2312.Write their own code processing, in a short time, found a variety of situations too difficult to think about, always crawl garbled. Challenges: There may also be meta or meta, even if ther
}
Load JDBC Driver
Class.forName ("Org.gjt.mm.mysql.Driver"). newinstance ();
Connecting to a database
sqlcon= java.sql.DriverManager.getConnection ("Jdbc:mysql://localhost/test");
To create a statement object
sqlstmt = Sqlcon.createstatement (java.sql.resultset.type_scroll_insensitive,java.sql.resultset.concur_read_only) ; Execute SQL statement
strSQL = "SELECT name from note";
Execute the SQL statement and get the result set
Sqlrst = Sqlstmt.executequery (strSQL);
Get Total Records
Http://www.cnblogs.com/xiaoMzjm/p/3899366.htmlBackgroundIn the previous post Java Crawl Web page content Simple example (1)-using regular expressions inside, describes how to use regular expressions to parse the content of the Web page, although the regular expression is more general, but cumbersome, the amount of code
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.