type.java

来自「基于Struts的学校新闻发布系统」· Java 代码 · 共 62 行

JAVA
62
字号
// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   Type.java

package StudyNews;

import java.io.PrintStream;
import java.sql.ResultSet;
import java.util.Vector;

// Referenced classes of package StudyNews:
//            DB

public class Type
{

    public Type()
    {
    }

    public int getTypeId()
    {
        return typeId;
    }

    public void setTypeId(int typeId)
    {
        this.typeId = typeId;
    }

    public String getTypeName()
    {
        return typeName;
    }

    public void setTypeName(String typeName)
    {
        this.typeName = typeName;
    }

    public static Vector SearchType(DB db)
        throws Exception
    {
        Vector newsType = new Vector();
        String strSql = "select * from type";
        Type type;
        for(ResultSet typeRs = db.OpenSql(strSql); typeRs.next(); newsType.add(type))
        {
            type = new Type();
            type.setTypeId(typeRs.getInt("typeId"));
            type.setTypeName(typeRs.getString("typeName"));
        }

        System.out.println("\nnewsType:    " + newsType.size());
        return newsType;
    }

    private int typeId;
    private String typeName;
}

⌨️ 快捷键说明

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