为了账号安全,请及时绑定邮箱和手机立即绑定

各位慕友帮忙看看哦,谢谢,这是什么问题呢?

各位慕友帮忙看看哦,谢谢,这是什么问题呢?

疯子520520 2016-09-01 20:03:03
//增加 //此处必须手动添加id后才可调用save方法进行储存~~为什么呢?为什么有些不用呢?又该怎么添加? // sjzdflDAO sjzdfldao = new sjzdflDAO(); // sjzdfl sjzdfl0 = new sjzdfl(); // sjzdfl0.setSjzdflid(9);//这个样子加指定id,可是问题又来了,添加到的名称显示是??????怎么回事呢? // sjzdfl0.setSjzdflmc("测试数据字典分类"); // Transaction transaction = HibernateSessionFactory.getSession().beginTransaction(); // sjzdfldao.save(sjzdfl0); // transaction.commit(); //更新   <跟增加一样,在数据库中“测试”被“??”代替显示了 sjzdflDAO sjzdfldao = new sjzdflDAO(); sjzdfl sjzdfl0 = new sjzdfl(); sjzdfl0.setSjzdflid(9); sjzdfl0.setSjzdflmc("测试"); Transaction transaction = HibernateSessionFactory.getSession().beginTransaction(); sjzdfldao.attachDirty(sjzdfl0); transaction.commit(); 在数据库管理工具的显示是:1 企业类型-分类2 企业类型-类型3 开户银行-分类4 信息来源-分类5 客户满意度-分类9 ??添加的9号,显示的为什么是??呢错误信息:SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Defaulting to no-operation (NOP) logger implementationSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.2016-9-1 19:51:51 org.hibernate.annotations.common.Version <clinit>INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}2016-9-1 19:51:51 org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {4.1.4.Final}2016-9-1 19:51:51 org.hibernate.cfg.Environment <clinit>INFO: HHH000206: hibernate.properties not found2016-9-1 19:51:51 org.hibernate.cfg.Environment buildBytecodeProviderINFO: HHH000021: Bytecode provider name : javassist2016-9-1 19:51:51 org.hibernate.cfg.Configuration configureINFO: HHH000043: Configuring from resource: /hibernate.cfg.xml2016-9-1 19:51:51 org.hibernate.cfg.Configuration getConfigurationInputStreamINFO: HHH000040: Configuration resource: /hibernate.cfg.xml2016-9-1 19:51:51 org.hibernate.cfg.Configuration addResourceINFO: HHH000221: Reading mappings from resource: fz/po/sjzdxx.hbm.xml2016-9-1 19:51:51 org.hibernate.cfg.Configuration addResourceINFO: HHH000221: Reading mappings from resource: fz/po/sjzdfl.hbm.xml2016-9-1 19:51:51 org.hibernate.cfg.Configuration doConfigureINFO: HHH000041: Configured SessionFactory: null2016-9-1 19:51:51 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)2016-9-1 19:51:51 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000115: Hibernate connection pool size: 202016-9-1 19:51:51 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000006: Autocommit mode: false2016-9-1 19:51:51 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/beifengcrm]2016-9-1 19:51:51 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000046: Connection properties: {user=root, password=****}2016-9-1 19:51:52 org.hibernate.dialect.Dialect <init>INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect2016-9-1 19:51:52 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateServiceINFO: HHH000399: Using default transaction strategy (direct JDBC transactions)2016-9-1 19:51:52 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>INFO: HHH000397: Using ASTQueryTranslatorFactory
查看完整描述

3 回答

?
阿旭_

TA贡献217条经验 获得超353个赞

试试改成gbk或吉utf-8。不知道你那边都用的什么编码。

new String("测试".getBytes(),"UTF-8");//需要try catch


查看完整回答
1 反对 回复 2016-09-02
  • 疯子520520
    疯子520520
    是的,我知道,可是我不知道怎么改,试过了用的是MySQL,在myeclipse中向数据库添加新增数据时就是不能够显示中文,我该在哪改,怎么改呢?两边我都改过,就是没有用,谢谢
?
Zmorn

TA贡献14条经验 获得超4个赞

编码的问题,检查一下各个环节的编码

查看完整回答
反对 回复 2016-09-02
?
疯子520520

TA贡献39条经验 获得超236个赞

我貌似知道错误的原因,但是不知道怎么改,求指导

查看完整回答
反对 回复 2016-09-01
  • 3 回答
  • 0 关注
  • 2521 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信