"How to achieve records in the Struts database application" http://dev.9cbs.net/develop/Article/29/29224.shtm
[Program source code]
For program source code, this example is uniquely different from the program source code in "How to implement Struts Database Application", which is a dblistinsert.jsp file, which is to add a record page file.
Here, a DAO class is defined to implement functions such as data plus, delete, update, add, and generate zone strings. The getPagestr (int ipage) function is used to generate a pages string, and the int ipage parameter is used to transfer the current page number. The FindSQL (STRING SQL, INT iPAGE) function is used to find database data, and the String SQL parameter is used to deliver the SQL query statement string, and the int ipage parameter is used to transfer the current page number. . . . . . . . . . . (Omit)
Public class dblistdao {
Unrelated code that is not related to the record is omitted.
Public void create (dblist m_dblist) throws sqlexception {
PreparedStatement PS = NULL;
//
String SQL = "INSERT INTO DBO.TEST VALUES (?,?,?)
// createsql>
Try {
IF (con?isclosed ()) {
Throw New IllegalStateException ("Error.unexpected");
IF (! "Search" .Equals (search) // lookup and all display two different operations, which are different, which is handled here. If all it is displayed, remove "Search = Search &"