1.Myeclipse 自动生成的 HibernateSessionFactory 你可以直接用的,里面应该有个getSession方法吧,就不用每次都写一样的代码了2.不是new Configuration(),是config.configure()这个方法执行后,就把xml文件里面的内容加载到cofig对象里了
  configure()方法也可以带参数,可以自己指定配置文件的路径,名称,不写就默认是那个hibernate.cfg.xml

解决方案 »

  1.   

    <property name="dialect">net.sf.hibernate.dialect.SQLServerDialect </property> 
        <property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver </property> 
        <property name="connection.url">jdbc:sqlserver://localhost:1433;databasename=test </property> 
            <property name="connection.username">sa </property>    
            <property name="connection.password">sa </property> 
            <property name="show_sql">true </property>这里有错
    仔细看看书上吧
    还有一点你究竟是用hibernate2还是hibernate3
    想清楚再写代码