KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > dataaccess > DataSourceJDBCWithRowCount


1 /*
2  * $Header: /cvsroot/jdbforms/dbforms/examples/bookstore/WEB-INF/src/dataaccess/DataSourceJDBCWithRowCount.java,v 1.2 2004/10/26 19:51:53 hkollmann Exp $
3  * $Revision: 1.2 $
4  * $Date: 2004/10/26 19:51:53 $
5  *
6  * DbForms - a Rapid Application Development Framework
7  * Copyright (C) 2001 Joachim Peer <joepeer@excite.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  */

23
24 package dataaccess;
25
26 import org.dbforms.config.DbEventInterceptorData;
27 import org.dbforms.config.ResultSetVector;
28
29 import org.dbforms.event.datalist.dao.DataSourceJDBC;
30
31 import java.sql.SQLException JavaDoc;
32
33
34 public class DataSourceJDBCWithRowCount extends DataSourceJDBC {
35
36    
37    public DataSourceJDBCWithRowCount() {
38        super();
39        this.setCalcRowCount(true);
40    }
41    /**
42     * DOCUMENT ME!
43     *
44     * @param interceptorData DOCUMENT ME!
45     * @param startRow DOCUMENT ME!
46     * @param count DOCUMENT ME!
47     *
48     * @return DOCUMENT ME!
49     *
50     * @throws SQLException DOCUMENT ME!
51     */

52    protected ResultSetVector getResultSetVector(DbEventInterceptorData interceptorData,
53                                                 int startRow,
54                                                 int count)
55                                          throws SQLException JavaDoc {
56       ResultSetVector res = super.getResultSetVector(interceptorData, startRow,
57                                                      count);
58       res.setAttribute("ROWCOUNTALL", new Integer JavaDoc(getRowCount()));
59
60       return res;
61    }
62
63
64 }
65
Popular Tags