updatetag.java

来自「大家好啊 快来抢购J2ME东东 挺不错的啊 不要后悔啊 抓住机会」· Java 代码 · 共 34 行

JAVA
34
字号
package com.ora.jsp.tags.sql;

import java.util.*;
import java.sql.*;
import javax.sql.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import com.ora.jsp.sql.*;
import com.ora.jsp.sql.value.*;

/**
 * This class is a custom action for executing a SQL INSERT, UPDATE and
 * DELETE statements, as well as SQL DDL statements (e.g. CREATE TABLE).
 * The statement must be defined in the body of the action. It can
 * contain ? place holders, replaced by the value of <ora:sqlValue>
 * elements before execution. The number and order of place holders must
 * match the number and order of <ora:sqlValue> elements in the body.
 *
 * @author Hans Bergsten, Gefion software <hans@gefionsoftware.com>
 * @version 1.0
 */
public class UpdateTag extends DBTag {
    /**
     * Executes the SQL command as an "update" and returns an Integer
     * with the number of rows affected.
     *
     * @param sqlCommandBean the SQL command to execute
     * @return the number of rows affected as an Integer
     */
    public Object execute(SQLCommandBean sqlCommandBean)
        throws SQLException, UnsupportedTypeException {
        return new Integer(sqlCommandBean.executeUpdate());
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?