01: /*
02: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
03: * (license2)
04: * Initial Developer: H2 Group
05: */
06: package org.h2.test.synth.sql;
07:
08: import java.sql.SQLException;
09:
10: /**
11: * Represents a connection to a (real or simulated) database.
12: */
13: public interface DbInterface {
14:
15: void reset() throws SQLException;
16:
17: void connect() throws Exception;
18:
19: void disconnect() throws SQLException;
20:
21: void end() throws SQLException;
22:
23: void createTable(Table table) throws SQLException;
24:
25: void dropTable(Table table) throws SQLException;
26:
27: void createIndex(Index index) throws SQLException;
28:
29: void dropIndex(Index index) throws SQLException;
30:
31: Result insert(Table table, Column[] c, Value[] v)
32: throws SQLException;
33:
34: Result select(String sql) throws SQLException;
35:
36: Result delete(Table table, String condition) throws SQLException;
37:
38: /**
39: * Update the given table with the new values.
40: *
41: * @param table the table
42: * @param columns the columns to update
43: * @param values the new values
44: * @param condition the condition
45: * @return the result of the update
46: */
47: Result update(Table table, Column[] columns, Value[] values,
48: String condition) throws SQLException;
49:
50: void setAutoCommit(boolean b) throws SQLException;
51:
52: void commit() throws SQLException;
53:
54: void rollback() throws SQLException;
55: }
|