課程
/后端開發(fā)
/Java
/使用Struts2+Hibernate開發(fā)學(xué)生信息管理功能
用的hibernate5,請問怎么解決?
2016-04-22
源自:使用Struts2+Hibernate開發(fā)學(xué)生信息管理功能 2-3
正在回答
@Override public?boolean?usersLogin(Users?u)?{ //?TODO?Auto-generated?method?stub Transaction?tx?=?null; String?sql?=?""; try?{ Session?session?=?MyHibernateSessionFactory.getSessionFactory().getCurrentSession(); tx?=?session.beginTransaction(); sql?=?"select?*?from?users?where?username=??and?password=??"; Query?query?=?session.createSQLQuery(sql); query.setParameter(0,?u.getUsername()); query.setParameter(1,?u.getPassword()); List?list?=?query.list(); tx.commit(); if?(list.size()?>?0)?{ return?true; }?else?{ return?false; } }? catch?(Exception?ex)?{ ex.printStackTrace(); return?false; }? finally?{ if?(tx?!=?null)?{ //?tx.commit(); tx?=?null; } } }
映射關(guān)系沒有配置好。檢查struts.xml
qq_張狂與自由_0 提問者
舉報
Strust2+Hibernate整合開發(fā)案例,Java Web開發(fā)技能更上一層樓
2 回答Users is not mapped?
1 回答Users is not mapped
1 回答報錯了~~Users is not mapped
13 回答Users is not mapped 網(wǎng)上查了好多也沒解決
3 回答Students is not mapped [from Students]
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2017-04-19
2016-04-22
映射關(guān)系沒有配置好。檢查struts.xml