myUser is not mapped
数据库中的表 myUser要在哪些文件里配置啊??
User.hbm.xml 中配置不就OK了吗,还有哪里需要配置??
<hibernate-mapping>
<class name="com.test.Hibernate.User" table="myUser">
<id name="id" type="integer">
<column name="ID" />
<generator class="native"></generator>
</id>
<property name="username" type="string">
<column name="USERNAME" length="50" not-null="true" />
</property>
<property name="password" type="string">
<column name="PASSWORD" length="50" not-null="true" />
</property>
</class>
</hibernate-mapping>
数据库中的表 myUser要在哪些文件里配置啊??
User.hbm.xml 中配置不就OK了吗,还有哪里需要配置??
<hibernate-mapping>
<class name="com.test.Hibernate.User" table="myUser">
<id name="id" type="integer">
<column name="ID" />
<generator class="native"></generator>
</id>
<property name="username" type="string">
<column name="USERNAME" length="50" not-null="true" />
</property>
<property name="password" type="string">
<column name="PASSWORD" length="50" not-null="true" />
</property>
</class>
</hibernate-mapping>
javax.servlet.ServletException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (Communications link failure due to underlying
exception: java.net.SocketException: java.net.ConnectException: Connection refused: connect
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2555)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)我把数据库改成了SQLserver的,applicationContext.xml里的配置都改了,怎么还会去连接MySQL呢
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</property>
<property name="url">
<value>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=BBS</value>
</property>
<property name="username">
<value>sa</value>
</property>
<property name="password">
<value>sa</value>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
请问还有什么其他地方要改的吗??
还是没搞定,继续等