提交 279da7c5 authored 作者: Thomas Mueller's avatar Thomas Mueller

Issue 120: JaQu didn't close result sets.

上级 55a37c28
...@@ -16,6 +16,7 @@ import java.util.List; ...@@ -16,6 +16,7 @@ import java.util.List;
import org.h2.jaqu.util.ClassReader; import org.h2.jaqu.util.ClassReader;
import org.h2.jaqu.util.Utils; import org.h2.jaqu.util.Utils;
import org.h2.util.JdbcUtils;
/** /**
* This class represents a query. * This class represents a query.
* *
...@@ -55,6 +56,8 @@ public class Query<T> { ...@@ -55,6 +56,8 @@ public class Query<T> {
return value; return value;
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
JdbcUtils.closeSilently(rs);
} }
} }
...@@ -95,6 +98,8 @@ public class Query<T> { ...@@ -95,6 +98,8 @@ public class Query<T> {
} }
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
JdbcUtils.closeSilently(rs);
} }
return result; return result;
} }
...@@ -138,6 +143,8 @@ public class Query<T> { ...@@ -138,6 +143,8 @@ public class Query<T> {
} }
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
JdbcUtils.closeSilently(rs);
} }
return result; return result;
} }
...@@ -159,6 +166,8 @@ public class Query<T> { ...@@ -159,6 +166,8 @@ public class Query<T> {
} }
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
JdbcUtils.closeSilently(rs);
} }
return result; return result;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论