//首先创建实体类
package cn.com.bochy.entity;
public class hibernatebean {
private long id;
private String name;
private String pwd;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
//然后 实体类同包下新建类名.hbm.xml 实体类和数据表的映射文件 内容如下
//接下来新建hibernate配置文件
oracle.jdbc.OracleDriver
jdbc:oracle:thin:@admini-PC.mshome.net:1521:orcl
scott
scott
org.hibernate.dialect.OracleDialect
true
true
update
update
当前文章:hibernatexml配置
URL网址:
http://cxhlcq.com/article/jehdco.html