Method com.hysoft.cache.mgmt.bulkload.DomLoad.getTotalNum(long, String) may fail to clean up java.sql.Statement
This method may fail to clean up (close, dispose of) a stream, database object, or other resource requiring an explicit cleanup operation.
In general, if a method opens a stream or other resource, the method should use a try/finally block to ensure that the stream or resource is cleaned up before the method returns.
This bug pattern is essentially the same as the OS_OPEN_STREAM and ODR_OPEN_DATABASE_RESOURCE bug patterns, but is based on a different (and hopefully better) static analysis technique. We are interested is getting feedback about the usefulness of this bug pattern. To send feedback, either:
In particular, the false-positive suppression heuristics for this bug pattern have not been extensively tuned, so reports about false positives are helpful to us.
See Weimer and Necula, Finding and Preventing Run-Time Error Handling Mistakes, for a description of the analysis technique.
解决办法:
try{
....
} catch (Exception e) {
LOG.info(e);
e.printStackTrace();
} finally {
try {
if (resultSet != null) {
resultSet.close();
}
} catch (SQLException e) {
LOG.info(e);
e.printStackTrace();
}
try {
if (ps != null) {
ps.close();
}
} catch (SQLException e) {
LOG.info(e);
e.printStackTrace();
}
try {
if (connection != null) {
connection.close();
}
} catch (SQLException e) {
LOG.info(e);
e.printStackTrace();
}
}
分享到:
相关推荐
根据提供的文件信息,我们可以推断出这是一本关于学习Java编程语言的书籍,书名为《21天学通Java.6(第5版)》,作者为Rogers Cadenhead和Laura Lemay。这本书旨在帮助读者在较短的时间内掌握Java 6版本的基本概念和...
下完这两个文件后改名为Core.JavaServer.Faces.Second.Edition.May.2007.part1.rar和Core.JavaServer.Faces.Second.Edition.May.2007.part2.rar放在一起解压
下完这两个文件后改名为Core.JavaServer.Faces.Second.Edition.May.2007.part1.rar和Core.JavaServer.Faces.Second.Edition.May.2007.part2.rar放在一起解压
Sams.Teach.Yourself.SQL.in.24.Hours.5th.Edition.May.2011.pdf This book is dedicated to my parents, Thomas and Karlyn Stephens, who always taught me that I can achieve anything if determined. This book...
* Executes the given SQL statement, which may be an <code>INSERT, * <code>UPDATE, or <code>DELETE</code> statement or an SQL * statement that returns nothing, such as an SQL DDL statement. 执行给定...
《Apress.Pro.SQL.Server.2008.Policy.Based.Management.May.2010》这本书主要聚焦于SQL Server 2008中的策略基础管理(Policy-Based Management),这是一个强大的工具,旨在帮助数据库管理员更好地控制和管理他们...
《Apress.Expert.SQL.Server.2005.Development.May.2007》这本书是针对SQL Server 2005开发的一本专业指南,适用于从初学者到专家的各种技术水平的读者。作为微软数据库系统的重要版本,SQL Server 2005在企业级数据...
《Apress.Pro.EJB.3.Java.Persistence.API.May.2006》是一部关于企业级JavaBeans(EJB)3.0版本的专著,主要聚焦于Java持久性API(JPA)。EJB 3.0是Java EE平台的一个重要组成部分,它极大地简化了企业级应用的开发...
《Java并发实践》是Addison-Wesley在2006年出版的一本经典书籍,由Brian Goetz、Tim Peierls、Joshua Bloch、Joseph Bowles和David Holmes等专家合著,全面深入地探讨了Java编程中的多线程和并发问题。这本书是Java...
Sams.Agile.Java.Development.with.Spring.Hibernate.and.Eclipse.May.2006
THIS book covers the Java™ Native Interface (JNI). It will be useful to you if you are interested in any of the following: • integrating a Java application with legacy code written in languages such...
《Java并发实践》是Addison-Wesley在2006年5月出版的一本经典书籍,由Brian Goetz、Tim Peierls、Joshua Bloch、David Holmes和Doug Lea合著,全面深入地探讨了Java编程中的多线程和并发问题。这本书是Java并发领域...
《OCA.Oracle.Database.11g.SQL.Fundamentals.I.Exam.Guide.Exam.1Z0-051.May.2008.eBook-DDU》是针对Oracle数据库11g SQL基础I认证考试(1Z0-051)的一本指南。这个电子书详细介绍了备考者需要掌握的关键概念和技术...
However, functional programming may seem unfamiliar to developers who are used to using imperative and object-oriented techniques. The new additions to Java 8 offer the opportunity to develop more ...
《Prentice.Hall.SOA.Using.Java.Web.Services.May.2007》一书由Mark D. Hansen撰写,是面向服务架构(SOA)领域的重要参考书籍,特别是对于那些希望利用Java Web Services实现SOA的专业人士。本书深入探讨了如何...
2.3.2 Make it Fail . . . . . . . . . . . . 8 2.3.3 Simplify the Test Case . . . . . . . . . 9 2.3.4 Read the Right Error Message . . . . . . 9 2.3.5 Check the Plug . . . . . . . . . 9 2.3.6 Separate ...
About CleanWipe ...In rare situations, running CleanWipe may cause a computer to crash with a blue screen. If this occurs, restart the computer and run CleanWipe again to solve the problem.
《OCA Oracle Database 11g SQL Fundamentals I Exam Guide》是McGraw-Hill Osborne Media出版的一本针对Oracle数据库11g SQL基础的考试指南,主要为准备1Z0-051认证考试的学习者提供全面的知识点覆盖。这本书在2008...