View Javadoc

1   /*
2    * The contents of this file are subject to the terms 
3    * of the Common Development and Distribution License 
4    * (the "License").  You may not use this file except 
5    * in compliance with the License.
6    * 
7    * You can obtain a copy of the license at 
8    * http://www.sun.com/cddl/cddl.html. 
9    * See the License for the specific language governing 
10   * permissions and limitations under the License.
11   * 
12   * When distributing Covered Code, include this CDDL 
13   * HEADER in each file and include the License file at 
14   * license.txt.  If applicable, add the following below 
15   * this CDDL HEADER, with the fields enclosed by brackets 
16   * "[]" replaced with your own identifying information: 
17   * Portions Copyright [yyyy] [name of copyright owner]
18   * 
19   * Portions Copyright 2004 eBay, Inc.
20   */
21  package com.ebay.carad.os.vitalsigns.dao;
22  
23  import java.util.List;
24  
25  /***
26   * Defines an interface for executing arbitrary SQL against a database.
27   * Used to assist in accessing raw data for arbitrary reports, or as a data
28   * source from which data can be pulled to be logged as a DataPoint for 
29   * a "data in timeline" type report.
30   * 
31   * @author Jeremy Kraybill
32   * @author Jeremy Thomerson
33   * @version $Id$
34   */
35  public interface ISqlDAO {
36  	
37      /***
38       * Executes an arbitrary SQL select statement against the configured connection,
39       * and returns the result as a List of Maps (via Commons DbUtils).
40       * 
41       * @param query the SQL query to run
42       * @return a list of maps
43       */
44      public List findBySqlQuery(String query);
45  
46      /***
47       * Executes an arbitrary SQL UPDATE or INSERT statement against the configured connection.
48       * 
49       * @param query the SQL query to run
50       * @return the number of affected rows
51       */
52      public int updateWithSQL(String query);
53  
54  }