How to determine if a SQL (Update, DELETE) statement is successful ----------------------------------- -------------------------- Catch (SQLEXCEPTION E) {} catch does not have a mistake should be successful --------- -------------------------------------------------- ---- Statement object provides three ways to perform SQL statements 1.ResultSet ExecuteQuery (String SQL) execute query statements, such as ResultSet RS = Stmt.executeQuery (Select * from table_name ") 2.int ExecuteUpdate (STRING SQL) INSERT, UPDATE, DELETE, etc. The number of records, the number of records, the number of records, the number of records, 3. Boolean Execute (String SQL) Performs all SQL statements, returns whether the operation is successful, for INSERT, UPDATE, etc. After executeUpdate, if the value returned, if the value returned, it is 0 Failure, success is successful, with the third method, no need to say more
Cut strings in JSP:
For example: String ss = "Time: 2003/01/09 Event Description: Law enforcement departments (such as tax, industry and commerce, health bureaus) total charge, and no receipts, audiences think that they are charged."; I want to describe "incident:" I used to get rid of the teeth, how to do it, how to do it? -------------------------------------------------- ------------- String str1 = event description: "; string ss =" Time: 2003/01/09 Event Description: Law enforcement departments (such as tax, business, health bureaus) total charges, Without receipts, the audience believes that it is charged. "SS = ss.substring (ss.indexof (str1) str1.length ()); ------------------ -------------------------------------------- SS = "SDF0 # 0435 # 30dsaf # 7435 "; public void getsubstring () String strIpCode =" sdf0 # 0435 # 30dsaf # 7435 "; StringTokenizer st = new StringTokenizer (strIpCode," # "); String strReverseIp =" "; while (st.hasMoreTokens ( )) {String straTemp = st.nextToken (); system.out.println (strtemp)}}
Online number statistics