課程
/后端開發(fā)
/Java
/使用Struts2+Hibernate開發(fā)學(xué)生信息管理功能
這個(gè)報(bào)錯(cuò)怎么解決?
2017-10-30
源自:使用Struts2+Hibernate開發(fā)學(xué)生信息管理功能 2-3
正在回答
如果你把數(shù)據(jù)庫(kù)的jar包導(dǎo)入了的話就應(yīng)該看下你用的那個(gè)數(shù)據(jù)庫(kù)了下面是我針對(duì)不同數(shù)據(jù)庫(kù)百度的你先看看
無(wú)法創(chuàng)建請(qǐng)求服務(wù),后面跟著jdbc環(huán)境問(wèn)題,hibernate的配置文件中關(guān)于數(shù)據(jù)庫(kù)連接和配置的地方有問(wèn)題。這是連接oracle的代碼<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC"-//Hibernate/Hibernate Configuration DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration><session-factory><property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property><property name="hibernate.connection.url">jdbc:oracle:thin:@172.28.144.110:1521:SHKRP1QA</property><property name="hibernate.connection.username">TP</property><property name="hibernate.connection.password">PSH#TP</property><mapping class="it.robot.po.User_infor"/><mapping resource="it/robot/po/user_hbm.xml"/> </session-factory></hibernate-configuration>這是連接mysql的配置文件代碼<?xml version="1.0" encoding="GBK" ?><!DOCTYPE hibernate-configuration PUBLIC"-//Hibernate/Hibernate Configuration DTD//EN""http://www.hibernate.org/dtd/hibernate-Configuration-3.0.dtd"><hibernate-configuration><session-factory><property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property><property name="hibernate.connection.url">jdbc:mysql://localhost:3306/shopping</property><property name="hibernate.connection.username">root</property><property name="hibernate.connection.password">root</property><property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property><property name="show_sql">true</property><mapping resource="Newsss.hbm.xml"/></session-factory></hibernate-configuration> 其實(shí) 很有可能是你配置文件中沒有配置數(shù)據(jù)庫(kù)方言,你試試配置一下數(shù)據(jù)庫(kù)方言mysql的方言就是上面代碼中<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
是這個(gè) ? ?Unable to create requested service
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update!是這個(gè)錯(cuò)誤嗎???
慕移動(dòng)7259470 提問(wèn)者
是不是沒有連接數(shù)據(jù)庫(kù)???原諒我電腦的分辨率讓我沒有看清楚報(bào)錯(cuò)原因
舉報(bào)
Strust2+Hibernate整合開發(fā)案例,Java Web開發(fā)技能更上一層樓
2 回答TestUsersDAOImpl運(yùn)行失敗。
1 回答query.setParameter()報(bào)錯(cuò)
2 回答Junit報(bào)錯(cuò)
2 回答hibernate報(bào)錯(cuò)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-11-01
如果你把數(shù)據(jù)庫(kù)的jar包導(dǎo)入了的話就應(yīng)該看下你用的那個(gè)數(shù)據(jù)庫(kù)了下面是我針對(duì)不同數(shù)據(jù)庫(kù)百度的你先看看
無(wú)法創(chuàng)建請(qǐng)求服務(wù),后面跟著jdbc環(huán)境問(wèn)題,hibernate的配置文件中關(guān)于數(shù)據(jù)庫(kù)連接和配置的地方有問(wèn)題。
這是連接oracle的代碼
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@172.28.144.110:1521:SHKRP1QA</property>
<property name="hibernate.connection.username">TP</property>
<property name="hibernate.connection.password">PSH#TP</property>
<mapping class="it.robot.po.User_infor"/>
<mapping resource="it/robot/po/user_hbm.xml"/>
</session-factory>
</hibernate-configuration>
這是連接mysql的配置文件代碼
<?xml version="1.0" encoding="GBK" ?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-Configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/shopping
</property>
<property name="hibernate.connection.username">
root
</property>
<property name="hibernate.connection.password">
root
</property>
<property name="dialect">
org.hibernate.dialect.MySQLInnoDBDialect
</property>
<property name="show_sql">true</property>
<mapping resource="Newsss.hbm.xml"/>
</session-factory>
</hibernate-configuration>
其實(shí) 很有可能是你配置文件中沒有配置數(shù)據(jù)庫(kù)方言,你試試配置一下數(shù)據(jù)庫(kù)方言
mysql的方言就是上面代碼中
<property name="dialect">
org.hibernate.dialect.MySQLInnoDBDialect
</property>
2017-11-01
是這個(gè) ? ?Unable to create requested service
2017-11-01
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update!是這個(gè)錯(cuò)誤嗎???
2017-10-31
是不是沒有連接數(shù)據(jù)庫(kù)???原諒我電腦的分辨率讓我沒有看清楚報(bào)錯(cuò)原因