为了账号安全,请及时绑定邮箱和手机立即绑定

运行第一章的例子时测试报错,控制台显示如下错误,跪求解答

二月 23, 2018 10:13:13 上午 org.hibernate.cfg.Configuration doConfigure

INFO: HHH000041: Configured SessionFactory: null

二月 23, 2018 10:13:13 上午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)

二月 23, 2018 10:13:13 上午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000115: Hibernate connection pool size: 20

二月 23, 2018 10:13:13 上午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000006: Autocommit mode: false

二月 23, 2018 10:13:13 上午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:///practice?useUnicode=true&characterEncoding=UTF-8]

二月 23, 2018 10:13:13 上午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000046: Connection properties: {user=root, password=****}

二月 23, 2018 10:13:13 上午 org.hibernate.dialect.Dialect <init>

INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect

二月 23, 2018 10:13:13 上午 org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation

INFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4


正在回答

2 回答

public class Students {

   private int sid;

   private String sname;

   private String gender;

   private Date birthday;

   private String address;

   

   public Students(){}


   public Students(int sid, String sname, String gender, Date birthday, String address) {

//super();

this.sid = sid;

this.sname = sname;

this.gender = gender;

this.birthday = birthday;

this.address = address;

   }


   public int getSid() {

return sid;

   }


   public void setSid(int sid) {

this.sid = sid;

   }


   public String getSname() {

return sname;

   }


   public void setSname(String sname) {

this.sname = sname;

   }


   public String getGender() {

return gender;

   }


   public void setGender(String gender) {

this.gender = gender;

   }


   public Date getBirthday() {

return birthday;

   }


   public void setBirthday(Date birthday) {

this.birthday = birthday;

   }


   public String getAddress() {

return address;

   }


   public void setAddress(String address) {

this.address = address;

   }


@Override

public String toString() {

return "Students [sid=" + sid + ", sname=" + sname + ", gender=" + gender + ", birthday=" + birthday + ", address="

+ address + "]";

}

   

   

}


0 回复 有任何疑惑可以回复我~

检查下 bean类是否匹配 hbm.xml 文件

1、属性是否匹配

2、属性值否匹配

最好把配置文件贴出来看看

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

运行第一章的例子时测试报错,控制台显示如下错误,跪求解答

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信