Package 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
Modifier and TypeMethodDescriptionvoidcommit()Commit a pending transaction.voidconnect()Connect to the database.voidcreateIndex(Index index) Create an index.voidcreateTable(org.h2.test.synth.sql.Table table) Create the specified table.org.h2.test.synth.sql.ResultDelete a number of rows.voidDisconnect from the database.voidDrop an index.voiddropTable(org.h2.test.synth.sql.Table table) Drop the specified table.voidend()Close the connection and the database.org.h2.test.synth.sql.ResultInsert a row into a table.voidreset()Drop all objects in the database.voidrollback()Roll back a pending transaction.org.h2.test.synth.sql.ResultExecute a query.voidsetAutoCommit(boolean b) Enable or disable autocommit.org.h2.test.synth.sql.Resultupdate(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] columns, Value[] values, String condition) Update the given table with the new values.
-
Method Details
-
reset
Drop all objects in the database.- Throws:
SQLException
-
connect
Connect to the database.- Throws:
Exception
-
disconnect
Disconnect from the database.- Throws:
SQLException
-
end
Close the connection and the database.- Throws:
SQLException
-
createTable
Create the specified table.- Parameters:
table- the table to create- Throws:
SQLException
-
dropTable
Drop the specified table.- Parameters:
table- the table to drop- Throws:
SQLException
-
createIndex
Create an index.- Parameters:
index- the index to create- Throws:
SQLException
-
dropIndex
Drop an index.- Parameters:
index- the index to drop- Throws:
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 SQLException Insert a row into a table.- Parameters:
table- the tablec- the column listv- the values- Returns:
- the result
- Throws:
SQLException
-
select
Execute a query.- Parameters:
sql- the SQL statement- Returns:
- the result
- Throws:
SQLException
-
delete
org.h2.test.synth.sql.Result delete(org.h2.test.synth.sql.Table table, String condition) throws SQLException Delete a number of rows.- Parameters:
table- the tablecondition- the condition- Returns:
- the result
- Throws:
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, String condition) throws SQLException Update the given table with the new values.- Parameters:
table- the tablecolumns- the columns to updatevalues- the new valuescondition- the condition- Returns:
- the result of the update
- Throws:
SQLException
-
setAutoCommit
Enable or disable autocommit.- Parameters:
b- the new value- Throws:
SQLException
-
commit
Commit a pending transaction.- Throws:
SQLException
-
rollback
Roll back a pending transaction.- Throws:
SQLException
-