Package io.github.pigaut.sql.database
Class FileDatabase
java.lang.Object
io.github.pigaut.sql.database.FileDatabase
- All Implemented Interfaces:
Database
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclearTable(String table)voidcreateStatement(String sql)Creates a statement for this database with the given sqlvoidcreateTableIfNotExists(String name, String... columns)voidvoidExecutes a SQL statement against the database.longexecuteLargeUpdate(String sql)Executes a large update SQL statement that may modify the database.voidexecuteQuery(String sql, QueryReader reader)Executes an SQL query and processes the results using a QueryReader.voidexecuteRowQuery(String sql, QueryReader reader)Executes an SQL query and processes the results using a QueryReader.intexecuteUpdate(String sql)Executes an SQL statement that may modify the database (such as INSERT, UPDATE, DELETE).Retrieves the DataSource associated with this database.booleanvoidvoidrenameColumn(String table, String column, String newName)voidrenameTable(String table, String newName)
-
Constructor Details
-
FileDatabase
-
-
Method Details
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceDatabase
-
openConnection
public void openConnection()- Specified by:
openConnectionin interfaceDatabase
-
closeConnection
public void closeConnection()- Specified by:
closeConnectionin interfaceDatabase
-
createStatement
Description copied from interface:DatabaseCreates a statement for this database with the given sql- Specified by:
createStatementin interfaceDatabase- Parameters:
sql- the sql statement- Returns:
- a new DatabaseStatement
-
getDataSource
Description copied from interface:DatabaseRetrieves the DataSource associated with this database.- Specified by:
getDataSourcein interfaceDatabase- Returns:
- The DataSource instance used for database connections.
-
createTableIfNotExists
- Specified by:
createTableIfNotExistsin interfaceDatabase
-
dropTable
-
renameTable
- Specified by:
renameTablein interfaceDatabase
-
addColumn
-
renameColumn
- Specified by:
renameColumnin interfaceDatabase
-
clearTable
- Specified by:
clearTablein interfaceDatabase
-
insert
-
merge
-
selectAll
-
execute
Description copied from interface:DatabaseExecutes a SQL statement against the database. -
executeUpdate
Description copied from interface:DatabaseExecutes an SQL statement that may modify the database (such as INSERT, UPDATE, DELETE).- Specified by:
executeUpdatein interfaceDatabase- Parameters:
sql- The SQL statement to execute.- Returns:
- The number of rows affected by the statement.
-
executeLargeUpdate
Description copied from interface:DatabaseExecutes a large update SQL statement that may modify the database.- Specified by:
executeLargeUpdatein interfaceDatabase- Parameters:
sql- The SQL statement to execute.- Returns:
- The number of rows affected by the statement.
-
executeQuery
Description copied from interface:DatabaseExecutes an SQL query and processes the results using a QueryReader.- Specified by:
executeQueryin interfaceDatabase- Parameters:
sql- The SQL query to execute.reader- The QueryReader implementation to process the query results.
-
executeRowQuery
Description copied from interface:DatabaseExecutes an SQL query and processes the results using a QueryReader.- Specified by:
executeRowQueryin interfaceDatabase- Parameters:
sql- The SQL query to execute.reader- The QueryReader implementation to process the query results.
-