DEBUG 高级篇

来源:互联网 发布:java api 1.6 中文 编辑:程序博客网 时间:2024/06/14 04:02

1.hibernate sql调试篇

//service层代码@Overridepublic List<CodeArea> getCodeAreaInfo() throws Exception {try {Map<String,String> map = new HashMap<String,String>();return basicDataDao.getCodeAreaInfo(map);} catch (Exception e) {throw e;}}注:控制台无明显报错,此时查看e的类型即可获知异常类型。


2.在控制台显示sql语句

<prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop><span style="color:#FF0000;"><prop key="hibernate.show_sql">true</prop><prop key="hibernate.format_sql">true</prop></span><prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>




0 0