在myeclipse中
public static void main(String[] args) {
// TODO Auto-generated method stub
try
{
Configuration cfg = new Configuration().addFile("src\\Newtable.hbm.xml");
SessionFactory cf = cfg.buildSessionFactory();
Session session = cf.openSession();
Transaction tx = session.beginTransaction();
Newtable test = new Newtable();
test.setName("haha");
test.setTel("134");
session.save(test);
tx.commit();
session.close();
}
catch(Exception ex)
{
System.out.print(ex.toString());
}请高手指教上面是什么问题
public static void main(String[] args) {
// TODO Auto-generated method stub
try
{
Configuration cfg = new Configuration().addFile("src\\Newtable.hbm.xml");
SessionFactory cf = cfg.buildSessionFactory();
Session session = cf.openSession();
Transaction tx = session.beginTransaction();
Newtable test = new Newtable();
test.setName("haha");
test.setTel("134");
session.save(test);
tx.commit();
session.close();
}
catch(Exception ex)
{
System.out.print(ex.toString());
}请高手指教上面是什么问题
解决方案 »
- 求java项目tomcat服务器如何发布在外网公司服务器已有。
- 怎样才能更好更快的分析业务
- ireport报表如何制作宽度大于高度,且页面方向为“纵向”的报表
- MVC开发模式中,表单如何访问控制器servlet的问题 望同胞们指点下
- 请问eclipse查找类的快捷键是什么?弹出查找窗口左上角是open type
- 页尾加载速度慢--产生影响及原因
- 用easyui的form组件发ajax得不到响应
- 【【【【【resin下到底把servlet的class放在那里???】】】】】】
- 求救!!!!!!!!!
- JSP中如何删除字符串的前后空格的,asp中是Ltrim和Rtrim,JSP中是什么呢?在线等待
- 这样的方式是否返回同一个对象。或者是多个对象。
- 请教一个字符串转换函数 (裸体跪求)
<property name="myeclipse.connection.profile">myhib</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/test
</property>
<property name="connection.username">huang</property>
<property name="connection.password"></property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<mapping resource="/Newtable.hbm.xml" />
</session-factory>