amentgatherswatch.java~5~

来自「野生动物系统的JAVA源码, 野生动物系统的JAVA源码」· JAVA~5~ 代码 · 共 62 行

JAVA~5~
62
字号
package scout.operation.gather_swatch;

import java.util.*;
import scout.util.*;
import scout.database.util.*;
import java.sql.*;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: Chongqing Kemeida corporation</p>
 *
 * @author Leizhao
 * @version 1.0
 */

public class AmentGatherSwatch {
    public AmentGatherSwatch() {
    }
    Connection con = null;
    /** 返回所有数据 */
    public Vector getResult(String id) {
        Vector v = new Vector();
        ConnDataBase db = new ConnDataBase();
        this.con = db.getConnection();
        QueryData qd = new QueryData(con);
        String sql = "select * from swatchlist where swatchNoteID =" + id;
        System.out.println("sql:"+sql);
        ResultSet rs = qd.getResultSet(sql);
        try {
            while (rs.next()) {
                Object[] obj = new Object[5];//读取两个数据。
                obj[0] = rs.getString("number");
                obj[1] = rs.getString("swatchClass");
                obj[2] = rs.getInt("swatchNumber");
                obj[3] = rs.getString("packClass");
                obj[4] = rs.getString("id");

                //查找与之对应的权限名称。
                System.out.println("obj[0]: " + obj[0]);
                System.out.println("obj[4]: " + obj[4]);
                v.add(obj);
            }
            rs.close();
            con.close();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return v;
    }

    public static void main(String[] args) {
        AmentGatherSwatch ae = new AmentGatherSwatch();
        Vector v = new Vector();
        v = ae.getResult("1");
    }
}

⌨️ 快捷键说明

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