`
文章列表
<isNotNull prepend="and" property="products"> product in <iterate property="products" open="(" close=")" conjunction=","> #products[]# </iterate> </isNotNull>  在上面的sqlMap中要 ...
http://www.open-open.com/doc/view/b929bfd3f671447b945161adf6e46641
Ibatis的SqlExecutor类里: public int executeBatch() throws SQLException { int totalRowCount = 0; for (int i = 0, n = statementList.size(); i < n; i++) { PreparedStatement ps = (PreparedStatement) statementList.get(i); int[] rowCounts = ps.executeBatch(); f ...

sql注入解决

http://thinkinmylife.iteye.com/blog/358475     sql注入学习:http://netsecurity.51cto.com/art/201108/287651.htm
volatile语义:告诉处理器,不要到工作内存中找我,而是直接到主存中操作我,多线程或者多核环境下,变量共享使用volatile要注意,他只能保证可见性,但不能保证原子性; 如i++之类的操作,他分为read i的值,之后执行i+1 当出现并发情况时,1线程read i的值,而2线程修改了i的值,这个时候1线程如果再将值刷到主存的话就会造成覆盖。可以通过synchronized在同步代码段,保证原子性或者使用jdk1.5的原子包 参考: java中volatile关键字的含义 参考中的例子说服力不是很够,这里重写了参考的例子,使得其更有说服力。   public clas ...
Executor的系列类图如下:这一些了类或接口都是和任务提交和执行相关的。   java.util.concurrent.AbstractExecutorService (implements java.util.concurrent.ExecutorService extends  java.util.concurrent.Executor) java.util.concurrent.ThreadPoolExecutor java.util.concurrent.ScheduledThreadPoolExecutor (implements java.util.conc ...
摘要:解决问题最重要的习惯不是一直盯着屏幕和编写修改代码,某些时候,阻止你成功的东西恰恰会是过于努力。这时候你需要暂停一下,平缓你的思绪,换一种方法或许能带给你不一样的效果。 你会花多少时间思考如何编写代码? 乍看这是一个引人思考的深层次问题,在编程专业中常有这样的误解,软件开发就是写代码。软件开发实为一门艺术,而代码仅仅是通往艺术之门的工具。好比燃料和画布是画家的工具一样,代码的目的是实现某种策略和思路。对程序员来说,他的目标是开发出完整的软件系统,按照需求完成各个功能模块或许是某种无形的思路、特性。比如一个深思熟虑的架构、明确的内部组织和代码质量,最后将这些进行整合。画家每隔 ...
1.第一种:   ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring/XXX.xml");   用ClassPathXmlApplicationContext, FileSystemClassPathXmlApplicationContext, FileSystemXmlApplicationContext等对象去加载Spring配置文件,这样做也是可以, 但是在加载Spring配置文件的时候,就会生成一个新的ApplicaitonContext对象而不是S ...
  private Constructor<T> getConstructor0(Class[] parameterTypes, int which) throws NoSuchMethodException { Constructor[] constructors = privateGetDeclaredConstructors((which == Member.PUBLIC)); //获取public的构造方法 for (int i = 0; ...
java.lang.Class获取类装载器的过程   /** * 返回此类的ClassLoader * 如果此类(例如java.lang.String)是由bootstrap ClassLoader装载的返回null * 原始类型返回null * 如果Class对象表示的是数组,则获得的ClassLoader是元素的ClassLoader * 例如: * 1(new Test[10]).getClass().getClassLoader()返回null,因为元素是原始类型 * 2(new Str ...
/** * Override the thread context ClassLoader with the environment's bean ClassLoader * if necessary, i.e. if the bean ClassLoader is not equivalent to the thread * context ClassLoader already. * @param classLoaderToUse the actual ClassLoader to use for the thread context * @return ...
部署在项目开发过程中是常有的事,特别是debug的时候。但是如果每次fix一个bug都要把整个项目重新部署一遍以便测试fix的效果或者继续debug其他bug,那对开发人员来说无疑是一大噩梦。不过谁都不想噩梦连连,有了JVM的hotSwap ...
  1、 BeanFactory     BeanFactory定义了 IOC 容器的最基本形式,并提供了 IOC 容器应遵守的的最基本的接口,也就是 Spring IOC所遵守的最底层和最基本的编程规范。在  Spring 代码中, BeanFactory 只是个接口,并不是 IOC 容器的具体实现,但是 Spring 容器给出了很多种实现,如 DefaultListableBeanFactory 、 XmlBeanFactory 、ApplicationContext 等,都是附加了某种功能的实现。     2、 FactoryBean
rownum背后的机制: 1 Oracle executes your query. 2 Oracle fetches the first row and calls it row number 1. 3 Have we gotten past row number meets the criteria? If no, then Oracle discards the row, If yes, then Oracle return the row. 4 Oracle fetches the next row and advances the row numb ...
eclipse 调试技巧总结     eclipse快捷键
Global site tag (gtag.js) - Google Analytics