Today work using ibaits write SQL, one of which is insert statement
That's what I wrote in Sqlmap, <insert.
Parameterclass= "..."
resultclass= "Java.lang.Integer" >
The following error was reported:
Org.xml.sax.SAXParseException:Attribute "ResultClass" must is declared for element type "insert".
first of all , do not say my mistake, mainly this error message, checked on the Internet, there are problems.
the correct error message should be:
Org.xml.sax.SAXParseException:Attribute "ResultClass" must is declared for element type "insert".
then analyze the cause of the error:
Two ways we all know about statement in JDBC
ResultSet |
ExecuteQuery (String SQL) Executes the given SQL statement, which returns a single ResultSet object. |
Int |
executeupdate (String SQL) Executes the given SQL statement, which May is an INSERT, UPDATE, or DELETE statement or a SQL statement that returns n Othing, such as an SQL DDL statement. |
These two methods, where the result set is our general definition of Sqlid001output.java, but as the number of updates or inserts, is the system automatically returned, so we do not need to set, in the Ibaits Executeforupdate method return value is int, If we write back the value in the Sqlmap, it is the superfluous, and it also gives you the wrong message which is very confusing to you.