hibernate连接SQL Server2000出错
请问各位大侠我的这个程序问题出在哪里?非常感谢
主程序
package com.hibernate;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class ExportDB {
public static void main(String[] args) {
//读取hibernate.cfg.xml配置文件
Configuration cfg=new Configuration().configure();
//创建SchemaExport
SchemaExport export=new SchemaExport(cfg);
//创建数据库表
export.create(true, true);
}
}
User类:
/**
*
*/
package com.hibernate;
import java.util.Date;
public class User {
private String id;
private String name;
private String password;
private Date createTime;
private Date expireTime;
/**
* @return the id
*/
public String getId() {
return this.id;
}
/**
* @param id the id to set
*/
public void setId(String id) {
this.id = id;
}
/**
* @return the name
*/
public String getName() {
return this.name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the password
*/
public String getPassword() {
return this.password;
}
/**
* @param password the password to set
*/
public void setPassword(String password) {
this.password = password;
}
/**
* @return the createTime
*/
public Date getCreateTime() {
return this.createTime;
}
/**
* @param createTime the createTime to set
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* @return the expireTime
*/
public Date getExpireTime() {
return this.expireTime;
}
/**
* @param expireTime the expireTime to set
*/
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
}
hibernate映射文件
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.hibernate.User">
<id name="id">
<generator class="uuid"></generator>
</id>
<property name="name"></property>
<property name="password"></property>
<property name="createTime"></property>
<property name="expireTime"></property>
</class>
</hibernate-mapping>
hibernate配置文件:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="foo">
<property name="hibernate.connection.url">jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=hibernate_simple</property>
<property name="hibernate.connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
<property name="hibernate.connection.username">sa</property>
<property name="connection.password"></property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
<mapping resource="com/hibernate/User.hbm.xml"/>
</session-factory>
</hibernate-configuration>
hibernate和SQL Server2000的驱动一切都配好了,运行一直报错“User附近有错误",数据库中也没有表创建,请各位大侠帮帮忙,非常感谢!!!