KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sellwin > db > DBInterface


1 package sellwin.db;
2
3 import java.sql.*;
4 import sellwin.utils.*;
5
6 // SellWin http://sourceforge.net/projects/sellwincrm
7
//Contact support@open-app.com for commercial help with SellWin
8
//This software is provided "AS IS", without a warranty of any kind.
9

10
11 /**
12  * This interface is implemented by all the database classes. It
13  * simply serves to enforce some of the more basic SQL routines that
14  * are to be supplied by the database layer classes.
15  */

16 public interface DBInterface {
17
18     /**
19      * get the Connection in use
20      *
21      * @return the Connection in use
22      */

23     public Connection getConnection();
24
25     /**
26      * set the Connection to use when inserting, deleting, etc.
27      *
28      * @param con the Connection to use
29      */

30     public void setConnection(Connection con)
31         throws SQLException;
32
33     /**
34      * perform a SQL UPDATE on a row
35      *
36      * @param obj use the contents to update table columns
37      */

38     public void updateRow(Object JavaDoc obj)
39         throws SQLException;
40
41     /**
42      * perform a SQL INSERT
43      *
44      * @param obj use the contents to insert a new row
45      * @param load true if the row is to be loaded, false if
46      * the row is to be added for the first time
47      */

48     public long insertRow(Object JavaDoc obj, boolean load)
49         throws SQLException;
50
51     /**
52      * perform a SQL DELETE
53      *
54      * @param obj use the contents to delete a row
55      */

56     public void deleteRow(Object JavaDoc obj)
57         throws SQLException;
58
59     /**
60      * perform a SQL SELECT
61      *
62      * @param obj use the contents to select a row
63      * @return the fetched row
64      */

65     public Object JavaDoc selectRow(Object JavaDoc obj)
66         throws SQLException;
67
68 }
69
Popular Tags