%line | %branch | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
javax.servlet.jsp.jstl.sql.ResultSupport |
|
|
1 | /* |
|
2 | * Copyright 2002,2004 The Apache Software Foundation. |
|
3 | * |
|
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 | * you may not use this file except in compliance with the License. |
|
6 | * You may obtain a copy of the License at |
|
7 | * |
|
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
9 | * |
|
10 | * Unless required by applicable law or agreed to in writing, software |
|
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 | * See the License for the specific language governing permissions and |
|
14 | * limitations under the License. |
|
15 | */ |
|
16 | ||
17 | package javax.servlet.jsp.jstl.sql; |
|
18 | ||
19 | import java.sql.ResultSet; |
|
20 | import java.sql.SQLException; |
|
21 | ||
22 | /** |
|
23 | * <p>This class represents the conversion of a ResultSet to |
|
24 | * a Result object.</p> |
|
25 | * |
|
26 | * |
|
27 | * @author Justyna Horwat |
|
28 | * |
|
29 | */ |
|
30 | 0 | public class ResultSupport { |
31 | ||
32 | ||
33 | /** |
|
34 | * Returns an array of Row objects. |
|
35 | * |
|
36 | * @param ResultSet the ResultSet object |
|
37 | * |
|
38 | * @return the <code>Result</code> object of the result |
|
39 | */ |
|
40 | public static Result toResult(ResultSet rs) { |
|
41 | try { |
|
42 | 0 | return new ResultImpl(rs, -1, -1); |
43 | } catch (SQLException ex) { |
|
44 | 0 | return null; |
45 | } |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * Returns the Result object of the cached ResultSet limited by maxRows |
|
50 | * |
|
51 | * @param ResultSet the ResultSet object |
|
52 | * @param maxRows the maximum number of rows |
|
53 | * |
|
54 | * @return the <code>Result</code> object of the result limited by maxRows |
|
55 | */ |
|
56 | public static Result toResult(ResultSet rs, int maxRows) { |
|
57 | try { |
|
58 | 0 | return new ResultImpl(rs, -1, maxRows); |
59 | } catch (SQLException ex) { |
|
60 | 0 | return null; |
61 | } |
|
62 | } |
|
63 | ||
64 | } |
This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |