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

hibernate往数据库里放照片 放不进去

hibernate往数据库里放照片 放不进去

黑窝 2017-02-16 12:06:13
二月 16, 2017 12:03:47 下午 org.hibernate.annotations.common.Version <clinit>INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}二月 16, 2017 12:03:47 下午 org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {4.2.21.Final}二月 16, 2017 12:03:47 下午 org.hibernate.cfg.Environment <clinit>INFO: HHH000206: hibernate.properties not found二月 16, 2017 12:03:47 下午 org.hibernate.cfg.Environment buildBytecodeProviderINFO: HHH000021: Bytecode provider name : javassist二月 16, 2017 12:03:47 下午 org.hibernate.cfg.Configuration configureINFO: HHH000043: Configuring from resource: /hibernate.cfg.xml二月 16, 2017 12:03:47 下午 org.hibernate.cfg.Configuration getConfigurationInputStreamINFO: HHH000040: Configuration resource: /hibernate.cfg.xml二月 16, 2017 12:03:47 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntityWARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!二月 16, 2017 12:03:47 下午 org.hibernate.cfg.Configuration addResourceINFO: HHH000221: Reading mappings from resource: stduents.hbm.xml二月 16, 2017 12:03:47 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntityWARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!二月 16, 2017 12:03:47 下午 org.hibernate.cfg.Configuration doConfigureINFO: HHH000041: Configured SessionFactory: null二月 16, 2017 12:03:47 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureWARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)二月 16, 2017 12:03:47 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000115: Hibernate connection pool size: 20二月 16, 2017 12:03:47 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000006: Autocommit mode: false二月 16, 2017 12:03:47 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:///hibernate?useUnicode=true&characterEncoding=UTF-8]二月 16, 2017 12:03:47 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureINFO: HHH000046: Connection properties: {user=root, password=****}二月 16, 2017 12:03:47 下午 org.hibernate.dialect.Dialect <init>INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect二月 16, 2017 12:03:47 下午 org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreationINFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4二月 16, 2017 12:03:47 下午 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateServiceINFO: HHH000399: Using default transaction strategy (direct JDBC transactions)二月 16, 2017 12:03:47 下午 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>INFO: HHH000397: Using ASTQueryTranslatorFactory二月 16, 2017 12:03:48 下午 org.hibernate.tool.hbm2ddl.SchemaExport executeINFO: HHH000227: Running hbm2ddl schema exportHibernate: drop table if exists STDUENTSHibernate: create table STDUENTS (SID integer not null, SNAME varchar(255), GENDER varchar(255), BIRTHDAY datetime, ADDRESS varchar(255), PHOTO mediumblob, primary key (SID))二月 16, 2017 12:03:48 下午 org.hibernate.tool.hbm2ddl.SchemaExport executeINFO: HHH000230: Schema export complete二月 16, 2017 12:03:48 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl stopINFO: HHH000030: Cleaning up connection pool [jdbc:mysql:///hibernate?useUnicode=true&characterEncoding=UTF-8]
查看完整描述

2 回答

已采纳
?
按照自己的节奏前行

TA贡献90条经验 获得超70个赞

首先,我想说放照片是可以的,

小伙子,你知道放照片的格式吗,要用BLOB /CLOB ,我记得好像是这种

还有,数据库基本不会存放照片,其实你可以存放照片的路径,就OK了,用varchar,节省数据库,又方便

查看完整回答
1 反对 回复 2017-02-19
?
彭耀辉

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

你提供代码呀,提供这个谁知道啊

查看完整回答
反对 回复 2017-02-17
  • 2 回答
  • 1 关注
  • 1488 浏览

添加回答

举报

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