org.h2.test.synth.sql
Interface DbInterface

All Known Implementing Classes:
DbState

public interface DbInterface

Represents a connection to a (real or simulated) database.


Method Summary
 void commit()
          Commit a pending transaction.
 void connect()
          Connect to the database.
 void createIndex(Index index)
          Create an index.
 void createTable(org.h2.test.synth.sql.Table table)
          Create the specified table.
 org.h2.test.synth.sql.Result delete(org.h2.test.synth.sql.Table table, java.lang.String condition)
          Delete a number of rows.
 void disconnect()
          Disconnect from the database.
 void dropIndex(Index index)
          Drop an index.
 void dropTable(org.h2.test.synth.sql.Table table)
          Drop the specified table.
 void end()
          Close the connection and the database.
 org.h2.test.synth.sql.Result insert(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] c, Value[] v)
          Insert a row into a table.
 void reset()
          Drop all objects in the database.
 void rollback()
          Roll back a pending transaction.
 org.h2.test.synth.sql.Result select(java.lang.String sql)
          Execute a query.
 void setAutoCommit(boolean b)
          Enable or disable autocommit.
 org.h2.test.synth.sql.Result update(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] columns, Value[] values, java.lang.String condition)
          Update the given table with the new values.
 

Method Detail

reset

void reset()
           throws java.sql.SQLException
Drop all objects in the database.

Throws:
java.sql.SQLException

connect

void connect()
             throws java.lang.Exception
Connect to the database.

Throws:
java.lang.Exception

disconnect

void disconnect()
                throws java.sql.SQLException
Disconnect from the database.

Throws:
java.sql.SQLException

end

void end()
         throws java.sql.SQLException
Close the connection and the database.

Throws:
java.sql.SQLException

createTable

void createTable(org.h2.test.synth.sql.Table table)
                 throws java.sql.SQLException
Create the specified table.

Parameters:
table - the table to create
Throws:
java.sql.SQLException

dropTable

void dropTable(org.h2.test.synth.sql.Table table)
               throws java.sql.SQLException
Drop the specified table.

Parameters:
table - the table to drop
Throws:
java.sql.SQLException

createIndex

void createIndex(Index index)
                 throws java.sql.SQLException
Create an index.

Parameters:
index - the index to create
Throws:
java.sql.SQLException

dropIndex

void dropIndex(Index index)
               throws java.sql.SQLException
Drop an index.

Parameters:
index - the index to drop
Throws:
java.sql.SQLException

insert

org.h2.test.synth.sql.Result insert(org.h2.test.synth.sql.Table table,
                                    org.h2.test.synth.sql.Column[] c,
                                    Value[] v)
                                    throws java.sql.SQLException
Insert a row into a table.

Parameters:
table - the table
c - the column list
v - the values
Returns:
the result
Throws:
java.sql.SQLException

select

org.h2.test.synth.sql.Result select(java.lang.String sql)
                                    throws java.sql.SQLException
Execute a query.

Parameters:
sql - the SQL statement
Returns:
the result
Throws:
java.sql.SQLException

delete

org.h2.test.synth.sql.Result delete(org.h2.test.synth.sql.Table table,
                                    java.lang.String condition)
                                    throws java.sql.SQLException
Delete a number of rows.

Parameters:
table - the table
condition - the condition
Returns:
the result
Throws:
java.sql.SQLException

update

org.h2.test.synth.sql.Result update(org.h2.test.synth.sql.Table table,
                                    org.h2.test.synth.sql.Column[] columns,
                                    Value[] values,
                                    java.lang.String condition)
                                    throws java.sql.SQLException
Update the given table with the new values.

Parameters:
table - the table
columns - the columns to update
values - the new values
condition - the condition
Returns:
the result of the update
Throws:
java.sql.SQLException

setAutoCommit

void setAutoCommit(boolean b)
                   throws java.sql.SQLException
Enable or disable autocommit.

Parameters:
b - the new value
Throws:
java.sql.SQLException

commit

void commit()
            throws java.sql.SQLException
Commit a pending transaction.

Throws:
java.sql.SQLException

rollback

void rollback()
              throws java.sql.SQLException
Roll back a pending transaction.

Throws:
java.sql.SQLException