真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Java操縱MongoDB_2(應(yīng)用場(chǎng)景設(shè)置)

應(yīng)用場(chǎng)景設(shè)置

網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)!專注于網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站建設(shè)、微信開(kāi)發(fā)、成都小程序開(kāi)發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了黃岡免費(fèi)建站歡迎大家使用!

以學(xué)生的信息管理系統(tǒng)為例,演示學(xué)生信息的增刪改查。這里定義學(xué)生的Bean類為:

Student.java

public class Student {

private String studentId;

private String name;

private int weight;

private int height;

private Date birthday;

public String getStudentId() {

return studentId;

}

public void setStudentId(String studentId) {

this.studentId = studentId;

}

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public int getWeight() {

return weight;

}

public void setWeight(int weight) {

this.weight = weight;

}

public int getHeight() {

return height;

}

public void setHeight(int height) {

this.height = height;

}

public Date getBirthday() {

return birthday;

}

public void setBirthday(Date birthday) {

this.birthday = birthday;

}

@Override

public String toString() {

return "Student [studentId=" + studentId + ", name=" + name

+ ", weight=" + weight + ", height=" + height + ", birthday="

+ birthday + "]";

}

public Student(String studentId, String name, int weight, int height,

Date birthday) {

super();

this.studentId = studentId;

this.name = name;

this.weight = weight;

this.height = height;

this.birthday = birthday;

}

public Student() {

}

}

并且定義了學(xué)生的增刪改查接口如下:

IStudentDao.java

public interface IStudentDao {

void insert(Student s);

void update(Student s);

void delete(String studentId);

}

操縱MongoDB的接口實(shí)現(xiàn)文件如下,

IStudentDaoImpl.java

public class IStudentDaoImpl implements IStudentDao{

@Override

public void insert(Student s) {

//暫未實(shí)現(xiàn)

}

@Override

public void update(Student s) {

//暫未實(shí)現(xiàn)

}

@Override

public void delete(String studentId) {

//暫未實(shí)現(xiàn)

}

}



網(wǎng)站標(biāo)題:Java操縱MongoDB_2(應(yīng)用場(chǎng)景設(shè)置)
分享鏈接:http://weahome.cn/article/gchcpc.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部