日期:2014-05-17  浏览次数:20653 次

初学者新手小菜求大神帮忙啊。。。。。。
本帖最后由 oMarlboro123456 于 2013-01-23 10:24:37 编辑
hibernate.cfg.xml里面的代码
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>

<session-factory>
<property name="dialect">
org.hibernate.dialect.SQLServerDialect
</property>
<property name="connection.url">
jdbc:sqlserver://localhost:1433
</property>
<property name="connection.username">sa</property>
<property name="connection.password">123</property>
<property name="connection.driver_class">
com.microsoft.sqlserver.jdbc.SQLServerDriver
</property>
<property name="myeclipse.connection.profile">House</property>
<property name="show_sql">true</property>
<mapping resource="cn/jbit/bean/Users.hbm.xml" />

</session-factory>

</hibernate-configuration>
Users.hbm.xml里面的代码
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd ">
<!-- 
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class name="cn.jbit.bean.Users" table="Users" schema="dbo" catalog="HouseRent">
        <id name="id" type="integer">
            <column name="id" />
            <generator class="identity" />
        </id>
        <property name="name" type="string">
            <column name="name" not-null="true" />
        </property>
        <property name="password" type="string">
            <column name="password" not-null="true" />
        </property>
        <property name="telephone" type="string">
            <column name="telephone" not-null="true" />
        </property>
        <property name="username" type="string">
            <column name="username" not-null="true" />
        </property>