View Javadoc

1   /***
2    * Copyright 2004 Steven Caswell
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  package com.mungoknotwise.sqlcli;
17  
18  import org.apache.log4j.Logger;
19  
20  /***
21   * Implementation of {@link UpdateRowcountHandler} that writes the rowcount
22   * to the object's print streams.
23   *
24   * @author  Steven Caswell
25   * @version $Id: PrintStreamedUpdateRowcountHandler.java,v 1.1.1.1 2004/07/28 01:12:38 mungoknotwise Exp $
26   */
27  public class PrintStreamedUpdateRowcountHandler
28    extends BasicPrintStreamed
29    implements UpdateRowcountHandler
30  {
31    
32    //----------------------------------------------------------------------------
33    // Static variables
34    //----------------------------------------------------------------------------
35    
36    private static Logger logger = Logger.getLogger(PrintStreamedUpdateRowcountHandler.class);
37    
38    //----------------------------------------------------------------------------
39    // Static methods
40    //----------------------------------------------------------------------------
41    
42    //----------------------------------------------------------------------------
43    // Constants
44    //----------------------------------------------------------------------------
45    
46    //----------------------------------------------------------------------------
47    // Instance variables
48    //----------------------------------------------------------------------------
49  
50    //----------------------------------------------------------------------------
51    // Constructors
52    //----------------------------------------------------------------------------
53    
54    /***
55     * Constructs a new instance of
56     * <code>PrintStreamedUpdateRowcountHandler</code>.
57     */
58    public PrintStreamedUpdateRowcountHandler()
59    {
60    }
61    
62    //----------------------------------------------------------------------------
63    // Interface implementations
64    //----------------------------------------------------------------------------
65    //----------------------------------------------------------------------------
66    // Implementation of interface UpdateRowcountHandler
67    //----------------------------------------------------------------------------
68  
69    /***
70     * {@inheritDoc}
71     */
72    public void handleRowcount(final int rowCount)
73    {
74      this.println("");
75      this.println(rowCount + " row(s)");
76      this.println("");
77    }
78    
79    //----------------------------------------------------------------------------
80    // Extends overrides
81    //----------------------------------------------------------------------------
82    //----------------------------------------------------------------------------
83    // Override of class Class1
84    //----------------------------------------------------------------------------
85    
86    
87    //----------------------------------------------------------------------------
88    // Public methods exposed by this class
89    //----------------------------------------------------------------------------
90    
91    //----------------------------------------------------------------------------
92    // Protected abstract methods
93    //----------------------------------------------------------------------------
94    
95    //----------------------------------------------------------------------------
96    // Protected methods for use by subclasses
97    //----------------------------------------------------------------------------
98    
99    //----------------------------------------------------------------------------
100   // Other methods
101   //----------------------------------------------------------------------------
102   
103   //----------------------------------------------------------------------------
104   // Member classes
105   //----------------------------------------------------------------------------
106   
107 }