第一步:先准备开发需要的 jar包 、工程包、已经创建数据库
二:创建代表book的javabean,并且生成一个有参以及一个无参的构造函数
package com.ccit.domain;
public class Book {
private String id;
private String name;
private double price;
private String description;
private String author;
public Book() {
super();
// TODO Auto-generated constructor stub
}
public Book(String id, String name, double price, String description,
String author) {
super();
this.id = id;
this.name = name;
this.price = price;
this.description = description;
this.author = author;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
}
三、创建代表数据库的类
四、创建数据层和service层之间的dao