在Service中使用ThreadLocal来完成事务,为将来学习Spring事务打基础!
1 DAO中的事务
public void xxx() {
Connection con = null;
try {
con = JdbcUtils.getConnection();
con.setAutoCommitted(false);
Query...
分类:
编程语言 时间:
2015-01-13 16:05:28
阅读次数:
176
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1-...
分类:
其他好文 时间:
2015-01-13 16:00:02
阅读次数:
137
命令:android update sdk --no-ui查看哪些包可以更新命令是:android list sdk也可以只更新需要的包,只需要加上--filter,android update sdk --filter --no-ui
例如:
android update sdk -u --filter platform-tools,android-16,extra-android-suppo...
分类:
移动开发 时间:
2015-01-13 14:22:39
阅读次数:
225
https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list/Given a sorted linked list, delete all duplicates such that each element appear on...
分类:
其他好文 时间:
2015-01-13 14:03:09
阅读次数:
114
Restrictions.like(属性名, 查询条件的值, 匹配方式):
Restrictions.in(属性名, 查询条件的值, 匹配方式):
Restrictions.eq(属性名, 查询条件的值, 匹配方式):
Criteria
Query常用的查询限制方法
Restrictions.eq() equal,=
Restrictions.a...
分类:
其他好文 时间:
2015-01-13 12:34:07
阅读次数:
162
After Update from jre-7_21 to jre-7_45: Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory() failed; error='Cannot allocate memory' (e...
分类:
编程语言 时间:
2015-01-13 11:55:24
阅读次数:
355
子查询在SELECT、UPDATE、DELETE语句内部可以出现SELECT语句。内部的SELECT语句结果可以作为外部语句中条件子句的一部分,
也可以作为外部查询的临时表。子查询的类型有:
1. 单行子查询:不向外部返回结果,或者只返回一行结果。
2. 多行子查询:向外部返回零行、一行或者多行结果。
单行子查询代码演示:查询出销售部(SALES)下面的员工姓名,工作,工资。该问题可以...
分类:
数据库 时间:
2015-01-13 10:32:02
阅读次数:
150
Posted on January 25, 2012 by Matthieu MEZIL 01/26/2012: Code update Imagine the following scenario: you have a WCF service with two methods:List GetC...
// 打开会话 Session session = HibernateUtil.getSession(); // 开启事务 Transaction tx = null; Wine wine; try { tx = session.beginTransaction(); Strin...
分类:
数据库 时间:
2015-01-13 10:17:22
阅读次数:
179
Hibernate查询
HQL vs EJBQL
1.NativeSQL>HQL>EJBQL(JPQL)>QBC(Query By Creteria)>QBE(Query By Example)
情景:
假设,Category表示的是论坛上的板块,Topic表示的是板块下面的主题,Msg表示的主题下的回复的帖子。
因而:Category和Topic之间是一对多。Topic和Msg是...
分类:
Web程序 时间:
2015-01-13 09:04:59
阅读次数:
203