Package org.h2.test.synth.sql
Class DbState
java.lang.Object
org.h2.test.synth.sql.DbState
- All Implemented Interfaces:
DbInterface
Represents a connection to a 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.toString()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
public void reset()Description copied from interface:DbInterfaceDrop all objects in the database.- Specified by:
resetin interfaceDbInterface
-
connect
public void connect()Description copied from interface:DbInterfaceConnect to the database.- Specified by:
connectin interfaceDbInterface
-
disconnect
public void disconnect()Description copied from interface:DbInterfaceDisconnect from the database.- Specified by:
disconnectin interfaceDbInterface
-
createTable
public void createTable(org.h2.test.synth.sql.Table table) Description copied from interface:DbInterfaceCreate the specified table.- Specified by:
createTablein interfaceDbInterface- Parameters:
table- the table to create
-
dropTable
public void dropTable(org.h2.test.synth.sql.Table table) Description copied from interface:DbInterfaceDrop the specified table.- Specified by:
dropTablein interfaceDbInterface- Parameters:
table- the table to drop
-
createIndex
Description copied from interface:DbInterfaceCreate an index.- Specified by:
createIndexin interfaceDbInterface- Parameters:
index- the index to create
-
dropIndex
Description copied from interface:DbInterfaceDrop an index.- Specified by:
dropIndexin interfaceDbInterface- Parameters:
index- the index to drop
-
insert
public org.h2.test.synth.sql.Result insert(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] c, Value[] v) Description copied from interface:DbInterfaceInsert a row into a table.- Specified by:
insertin interfaceDbInterface- Parameters:
table- the tablec- the column listv- the values- Returns:
- the result
-
select
Description copied from interface:DbInterfaceExecute a query.- Specified by:
selectin interfaceDbInterface- Parameters:
sql- the SQL statement- Returns:
- the result
-
delete
Description copied from interface:DbInterfaceDelete a number of rows.- Specified by:
deletein interfaceDbInterface- Parameters:
table- the tablecondition- the condition- Returns:
- the result
-
update
public 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) Description copied from interface:DbInterfaceUpdate the given table with the new values.- Specified by:
updatein interfaceDbInterface- Parameters:
table- the tablecolumns- the columns to updatevalues- the new valuescondition- the condition- Returns:
- the result of the update
-
setAutoCommit
public void setAutoCommit(boolean b) Description copied from interface:DbInterfaceEnable or disable autocommit.- Specified by:
setAutoCommitin interfaceDbInterface- Parameters:
b- the new value
-
commit
public void commit()Description copied from interface:DbInterfaceCommit a pending transaction.- Specified by:
commitin interfaceDbInterface
-
rollback
public void rollback()Description copied from interface:DbInterfaceRoll back a pending transaction.- Specified by:
rollbackin interfaceDbInterface
-
end
public void end()Description copied from interface:DbInterfaceClose the connection and the database.- Specified by:
endin interfaceDbInterface
-
toString
-