按照Hibernate例子做的Test.java跑不起来,麻烦帮忙解决! 问题有多种可能首先hibernate包有没有导入,然后hibernate.cfg.xml配置是否正确Custmer的定义是否正确只能一点点的找问题所在了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 hibernate.jar的包在CLASSPATH中设置了,hibernate.cfg.xml配置如下:---------------------<hibernate-configuration> <session-factory name="java:/hibernate/HibernateFactory"> <property name="show_sql">true</property> <property name="connection.dirver_class">com.jnetdirect.jsql.JSQLDriver</property> <property name="connection.url">jdbc:JSQLConnect://user/database=hibernate</property> <property name="connection.username">sa</property> <property name="connection.password">sa</property> <property name="dialect"></property> <mapping resource="Customer.hbm.xml" /> </session-factory> </hibernate-configuration>------------------------------------Customer.java 代码如下:------------------------------------public class Customer { private int id; private String username; private String password; public int getId(){ return id; } public String getPassword(){ return password; } public String getUsername(){ return username; } public void setId(int id){ this.id = id; } public void setPassword(String password){ this.password = password; } public void setUsername(String username){ this.username = username; }} Struts2日志配置问题请教 struts-dojo-plugins问题 一个项目模块怎么整理计划说应该怎样写?求指点第一次 JBPM 在ORACLE下 违反唯一约束的问题 如何写xml配置 来实现异构数据库之间映射 100分求Jive2.0-2.5源码 myeclipse4.0.2+resin3.0的部署问题 WebSpere与TomCat的比较!! 机子启动问题:有时候能启动,有时候启动不了(内详) java 正则表达式从字符串中提取特定字段的值 java bean的问题??? Hibernate測試類跑不起來!(愿給分!)
<property name="show_sql">true</property>
<property name="connection.dirver_class">com.jnetdirect.jsql.JSQLDriver</property>
<property name="connection.url">jdbc:JSQLConnect://user/database=hibernate</property>
<property name="connection.username">sa</property>
<property name="connection.password">sa</property>
<property name="dialect"></property>
<mapping resource="Customer.hbm.xml" />
</session-factory>
</hibernate-configuration>------------------------------------Customer.java 代码如下:------------------------------------public class Customer {
private int id;
private String username;
private String password;
public int getId(){
return id;
}
public String getPassword(){
return password;
}
public String getUsername(){
return username;
}
public void setId(int id){
this.id = id;
}
public void setPassword(String password){
this.password = password;
}
public void setUsername(String username){
this.username = username;
}
}