开发者社区> 问答> 正文

hibernate 根据持久化类 创建数据库表 报错如下所示:?报错

十二月 09, 2015 1:49:50 下午 org.hibernate.cfg.Environment <clinit>
信息: Hibernate 3.3.2.GA
十二月 09, 2015 1:49:50 下午 org.hibernate.cfg.Environment <clinit>
信息: hibernate.properties not found
十二月 09, 2015 1:49:50 下午 org.hibernate.cfg.Environment buildBytecodeProvider
信息: Bytecode provider name : javassist
十二月 09, 2015 1:49:50 下午 org.hibernate.cfg.Environment <clinit>
信息: using JDK 1.4 java.sql.Timestamp handling
十二月 09, 2015 1:49:50 下午 org.hibernate.cfg.Configuration configure
信息: configuring from resource: /hibernate.cfg.xml
十二月 09, 2015 1:49:50 下午 org.hibernate.cfg.Configuration getConfigurationInputStream
信息: Configuration resource: /hibernate.cfg.xml
十二月 09, 2015 1:49:50 下午 org.hibernate.cfg.Configuration addResource
信息: Reading mappings from resource : edu/ahut/model/DicTab.hbm.xml
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: edu.ahut.model.DicTab -> DIC_TAB
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.Configuration addResource
信息: Reading mappings from resource : edu/ahut/model/WebInfo.hbm.xml
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: edu.ahut.model.WebInfo -> WEBINFO
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.Configuration addResource
信息: Reading mappings from resource : edu/ahut/model/WebMenu.hbm.xml
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: edu.ahut.model.WebMenu -> WEBMENU
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.Configuration addResource
信息: Reading mappings from resource : edu/ahut/model/WebRole.hbm.xml
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: edu.ahut.model.WebRole -> WEBROLE
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.HbmBinder bindCollection
信息: Mapping collection: edu.ahut.model.WebRole.webMenus -> WEBRM
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.Configuration addResource
信息: Reading mappings from resource : edu/ahut/model/WebUser.hbm.xml
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: edu.ahut.model.WebUser -> WEBUSER
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.Configuration doConfigure
信息: Configured SessionFactory: null
十二月 09, 2015 1:49:51 下午 org.hibernate.connection.DriverManagerConnectionProvider configure
信息: Using Hibernate built-in connection pool (not for production use!)
十二月 09, 2015 1:49:51 下午 org.hibernate.connection.DriverManagerConnectionProvider configure
信息: Hibernate connection pool size: 20
十二月 09, 2015 1:49:51 下午 org.hibernate.connection.DriverManagerConnectionProvider configure
信息: autocommit mode: false
十二月 09, 2015 1:49:51 下午 org.hibernate.connection.DriverManagerConnectionProvider configure
信息: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/ssh
十二月 09, 2015 1:49:51 下午 org.hibernate.connection.DriverManagerConnectionProvider configure
信息: connection properties: {user=root, password=****}
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: RDBMS: MySQL, version: 5.0.24a-community-nt
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.7 ( Revision: ${svn.Revision} )
十二月 09, 2015 1:49:51 下午 org.hibernate.dialect.Dialect <init>
信息: Using dialect: org.hibernate.dialect.MySQLDialect
十二月 09, 2015 1:49:51 下午 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
信息: Using default transaction strategy (direct JDBC transactions)
十二月 09, 2015 1:49:51 下午 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
信息: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Automatic flush during beforeCompletion(): disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Automatic session close at end of transaction: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: JDBC batch size: 15
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: JDBC batch updates for versioned data: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Scrollable result sets: enabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: JDBC3 getGeneratedKeys(): enabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Connection release mode: auto
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Maximum outer join fetch depth: 2
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Default batch fetch size: 1
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Generate SQL with comments: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Order SQL updates by primary key: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Order SQL inserts for batching: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
信息: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
十二月 09, 2015 1:49:51 下午 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
信息: Using ASTQueryTranslatorFactory
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Query language substitutions: {}
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: JPA-QL strict compliance: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Second-level cache: enabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Query cache: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory createRegionFactory
信息: Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Optimize cache for minimal puts: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Structured second-level cache entries: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Echoing all SQL to stdout
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Statistics: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Deleted entity synthetic identifier rollback: disabled
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Default entity-mode: pojo
十二月 09, 2015 1:49:51 下午 org.hibernate.cfg.SettingsFactory buildSettings
信息: Named query checking : enabled
十二月 09, 2015 1:49:52 下午 org.hibernate.impl.SessionFactoryImpl <init>
信息: building session factory
十二月 09, 2015 1:49:52 下午 org.hibernate.impl.SessionFactoryObjectFactory addInstance
信息: Not binding factory to JNDI, no JNDI name configured
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
信息: Running hbm2ddl schema update
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
信息: fetching database metadata
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
信息: updating schema
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
信息: table not found: DIC_TAB
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
信息: table not found: WEBINFO
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
信息: table not found: WEBMENU
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
信息: table not found: WEBROLE
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
信息: table not found: WEBUSER
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
信息: table found: ssh.webrm
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
信息: columns: [menuid, rolecode]
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
信息: foreign keys: []
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
信息: indexes: []
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
信息: table not found: DIC_TAB
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
信息: table not found: WEBINFO
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
信息: table not found: WEBMENU
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
信息: table not found: WEBROLE
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
信息: table not found: WEBUSER
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unsuccessful: create table PROMAN.DIC_TAB (DIC_TAB_NAME varchar(255) not null, CODE_ID varchar(255) not null, STD_NAME varchar(2), DATA_SUBSET varchar(255) not null, STD_CODE varchar(255), DIC_TAB_DESC varchar(255), CODE_NAME varchar(255) not null, CODE_LEVEL bit, CODE_PARENT varchar(255), CODE_DISPLAY bit, CODE_SORT integer, IS_LEAF bit, primary key (DIC_TAB_NAME, CODE_ID))
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unknown database 'proman'
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unsuccessful: create table PROMAN.WEBINFO (ID varchar(255) not null, ORDERID integer, TITLE varchar(255), CONTENT varchar(255), AUTHOR varchar(255), ADDTIME datetime, PUBLISH bit, primary key (ID))
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unknown database 'proman'
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unsuccessful: create table PROMAN.WEBMENU (MENUID integer not null auto_increment, ORDERID integer, PARENTID integer, TEXT varchar(255), QTIP varchar(255), URL varchar(255), ICONCLS varchar(255), LEAF bit, SHOWFLAG bit, PARAM varchar(255), primary key (MENUID))
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unknown database 'proman'
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unsuccessful: create table PROMAN.WEBROLE (ROLECODE varchar(255) not null, ROLENAME varchar(255), MEMO varchar(255), primary key (ROLECODE))
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unknown database 'proman'
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unsuccessful: create table PROMAN.WEBUSER (USERNAME varchar(255) not null, ROLECODE varchar(255), USERCNAME varchar(255), USERPWD varchar(255), MOBILE varchar(255), EMAIL varchar(255), ISLOCK integer, DEPT varchar(255), primary key (USERNAME))
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unknown database 'proman'
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unsuccessful: alter table PROMAN.WEBUSER add index FK73C678FFB70C19B8 (ROLECODE), add constraint FK73C678FFB70C19B8 foreign key (ROLECODE) references PROMAN.WEBROLE (ROLECODE)
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Table 'proman.webuser' doesn't exist
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unsuccessful: alter table WEBRM add index FK4EA5C6F86A9F1F8 (MENUID), add constraint FK4EA5C6F86A9F1F8 foreign key (MENUID) references PROMAN.WEBMENU (MENUID)
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Can't create table '.\ssh#sql-7dc_2.frm' (errno: 150)
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Unsuccessful: alter table WEBRM add index FK4EA5C6FB70C19B8 (ROLECODE), add constraint FK4EA5C6FB70C19B8 foreign key (ROLECODE) references PROMAN.WEBROLE (ROLECODE)
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: Can't create table '.\ssh#sql-7dc_2.frm' (errno: 150)
十二月 09, 2015 1:49:52 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
信息: schema update complete


展开
收起
爱吃鱼的程序员 2020-06-10 10:14:09 746 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    把类的代码贴出来呢回复<aclass='referer'target='_blank'>@开源中国首席门卫小哥:类的代码太多,我有4个持久化类,org.hibernate.tool.hbm2ddl.SchemaUpdateexecute严重:Unknowndatabase'proman'这个错误什么意思?我数据库已经建立好了叫ssh这个Unknowndatabase'proman'什么意思?回复<aclass='referer'target='_blank'>@我爱编程zc:你hibernate配置文件里的database配置错了

    <spanstyle="color:#E53333;">严重:Unknowndatabase'proman'

    hibernate能帮你自动建表,已经很不错了,还要指望它能自动建数据库,着实有点为难它,另外,数据库结构这些东西,还是手动来建的好

    我是用持久化类来进行建立数据库中的表哦数据库我已经建立了好了叫ssh数据库建好后使用Hibernate非常好,你居然用Hibernate去创建数据库我数据库已经手动建立好了,我只是用持久化类来建立表,但是报错什么意思?Unknowndatabase'proman'我的数据是叫ssh这个proman怎么来的?无知最可怕你真当Hibernate万能???估计你在配置Hibernate的时候,没有配置对,没有找到对应的库。找到库,然后运行程序,自动生成表就可以了,然后就可以访问表了回复<aclass='referer'target='_blank'>@我爱编程zc:或者Hibernate包有问题也可能最好贴出代码我们就清楚了回复<aclass='referer'target='_blank'>@我爱编程zc:你执行自动生成表的那个程序看下如果还是找不到库就一定是那里的问题最好把代码贴出来真心看不见。。。配置文件是我自己配置的应该没问题呀!数据库连接配置,数据库的名字看一下

    这是你的配置你检查一下

    <imgsrc="http://static.oschina.net/uploads/space/2015/1209/154543_BDws_2528735.png"alt="">

    前面运行正常这里出现没有找到对应表 

    <imgsrc="http://static.oschina.net/uploads/space/2015/1209/154650_M3FX_2528735.png"alt="">

    这里出错,然后Hibernate默认连接,后面是由这一个错误而引发的,看一下Hibernat配置,特别是<spanstyle="font-size:10px;">*<spanstyle="font-family:Arial;font-size:10px;line-height:27px;background-color:#FFFFFF;">.hbm.xml文件和程序

    <imgsrc="http://static.oschina.net/uploads/space/2015/1209/154813_0bGy_2528735.png"alt="">

    回复<aclass='referer'target='_blank'>@我爱编程zc:客气了回复<aclass='referer'target='_blank'>@水门-kay:谢谢你的帮助!回复<aclass='referer'target='_blank'>@我爱编程zc:额我们马上要开会啊。。。我的邮箱1132892414@qq.com你发给我吧回复<aclass='referer'target='_blank'>@水门-kay:帮忙看下我的.hbm.xml文件?谢谢大神,对了之前的测试正确能够在ssh数据库中产生user表回复<aclass='referer'target='_blank'>@我爱编程zc:至于为什么显示Unknowdatabase'proman'感觉是由错误引发的应该不是配置的问题(⊙﹏⊙)b我也不清楚你的操作呀

    2020-06-10 10:14:28
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
2022 DTCC-阿里云一站式数据库上云最佳实践 立即下载
云时代的数据库技术趋势 立即下载
超大型金融机构国产数据库全面迁移成功实践 立即下载