classoftypes.java~2~

来自「基于mvc的宠物管理系统。servlet+jsp」· JAVA~2~ 代码 · 共 75 行

JAVA~2~
75
字号
package com.richard.dao;

import java.util.*;
import java.sql.ResultSet;
import com.richard.dto.*;


public class ClassOfTypes implements InterfaceOfTypes {
    DBOperate objDBOperate=new DBOperate();
    public ClassOfTypes() {
    }

    /**
     * typesDelete
     *
     * @param objTypes Types
     * @todo Implement this com.richard.dao.InterfaceOfTypes method
     */
    public void typesDelete(Types objTypes) {
    }

    /**
     * typesInsert
     *
     * @param objTypes Types
     * @todo Implement this com.richard.dao.InterfaceOfTypes method
     */
    public void typesInsert(Types objTypes) {
    }

    /**
     * typesQuery
     *
     * @param objTypes Types
     * @return Types
     * @todo Implement this com.richard.dao.InterfaceOfTypes method
     */
    public Types typesQuery(Types objTypes) {
        return null;
    }

    /**
     * typesQueryAll
     *
     * @return ArrayList
     * @todo Implement this com.richard.dao.InterfaceOfTypes method
     */
    public ArrayList typesQueryAll() {
        String sqlCommand="select * from types";
        ArrayList objArrayList=new ArrayList();
        ResultSet rs=objDBOperate.getResultSet("petclinic",sqlCommand);
        try {
            while(rs.next())
            {
                Types objTypes=new Types();
                objTypes.setId(rs.getInt(1));
                objTypes.setName(rs.getString(2));
                objArrayList.add(objTypes);
            }
        } catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
        return objArrayList;
    }

    /**
     * typesUpdate
     *
     * @param objTypes Types
     * @todo Implement this com.richard.dao.InterfaceOfTypes method
     */
    public void typesUpdate(Types objTypes) {
    }
}

⌨️ 快捷键说明

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