亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

運行提示這個怎么辦?1-11Hibernate 訪問數據庫

八月 16, 2017 6:54:49 下午 org.hibernate.annotations.common.Version <clinit>

INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}

八月 16, 2017 6:54:49 下午 org.hibernate.Version logVersion

INFO: HHH000412: Hibernate Core {4.2.4.Final}

八月 16, 2017 6:54:49 下午 org.hibernate.cfg.Environment <clinit>

INFO: HHH000206: hibernate.properties not found


八月 16, 2017 6:54:49 下午 org.hibernate.cfg.Environment buildBytecodeProvider

INFO: HHH000021: Bytecode provider name : javassist

八月 16, 2017 6:54:49 下午 org.hibernate.cfg.Configuration configure

INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml

八月 16, 2017 6:54:49 下午 org.hibernate.cfg.Configuration getConfigurationInputStream

INFO: HHH000040: Configuration resource: /hibernate.cfg.xml


正在回答

2 回答

百度解決了。改了hibernate.cfg.xml的配置

<property name="connection.url">jdbc:mysql://localhost:3306/hibernate</property> ?

? ? ? ? <property name="hibernate.connection.username">root</property> ?

? ? ? ? <property name="hibernate.connection.password">root</property>?


0 回復 有任何疑惑可以回復我~

如果用的版本是hibernate5.0以上的版本,則init()里面應該這樣寫:

//創建服務注冊對象
??ServiceRegistry serviceRegister = new StandardServiceRegistryBuilder().configure().build();
??//創建會話工廠對象
??sessionFactory = new MetadataSources(serviceRegister).buildMetadata().buildSessionFactory();
??//會話對象
??session = sessionFactory.openSession();
??//開啟事務
??transaction = session.beginTransaction();


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

運行提示這個怎么辦?1-11Hibernate 訪問數據庫

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號