1、工程目录结构如下hibernate操作数据库例子

2、引入需要的jar包,如上图。

3、创建持久化类User对应数据库中的user表

package com.hibernate.配置文件.pojo;

import java.sql.Date;

public class User {
    private Integer id;
    
    private String username;
    
    private String password;
    
    private Date update_time;
    
    

    public User() {
        super();
    }

    public User( String username, String password, Date update_time) {
        super();
        this.username = username;
        this.password = password;
        this.update_time = update_time;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }
    
    
}
View Code

相关文章:

  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-05
  • 2021-12-12
  • 2021-06-09
  • 2021-07-13
  • 2021-07-20
  • 2021-07-12
相关资源
相似解决方案