赞
踩
本次系统是基于上次简易版的宠物管理系统的升级,简易版详见java宠物管理系统(运用接口简易版)
功能依然有以下几点:
1.保存大量宠物信息
2.查看所有的宠物
3.通过名字查看某个宠物
4.输入宠物信息,录入系统中
5.修改系统中的宠物信息
6.删除宠物的信息
7.按年龄或价格进行排序
优化的有:编写了JDBC工具类,封装JDBC操作;
新增用户登录功能,只有登录成功才能使用该管理系统
create database pet;
use pet;
create table petuser
(
user_name VARCHAR(20) NOT NULL,
user_password VARCHAR(20) NOT NULL
);
INSERT INTO petuser(user_name,user_password)
VALUES('ab','123456'),('qw','1q2w3e'),('爬走','654321');
create table pets
(
name VARCHAR(20) NOT NULL,
gender VARCHAR(20) NOT NULL,
type VARCHAR(20) NOT NULL,
age INT NOT NULL,
price INT NOT NULL,
weight INT NOT NULL
);
INSERT INTO pets(name,gender,type,age,price,weight)
VALUES('white','M','dog',1,3000,2),('black','M','dog',2,2000,3),('blue','M','cat',1,1600,4),
('flower','F','cat',3,5000,3),('red','F','cat',1,4600,1);
用户表信息展示:
宠物表信息展示:
package demo; public class Pet { private String name; private String gender; private String type; private int age; private int price; private int weight; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public String getType() { return type; } public void setType(String type) { this.type = type; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } public int getWeight() { return weight; } public void setWeight(int weight) { this.weight = weight; } public Pet() { } public Pet(String name, String gender, String type, int age, int price, int weight
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。