Package classes
Class Database
- java.lang.Object
-
- classes.Database
-
- All Implemented Interfaces:
DataHandler
public class Database extends java.lang.Object implements DataHandler
The class for the MYSQL database- Author:
- gabrieleromanato
-
-
Constructor Summary
Constructors Constructor Description Database()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>>
readData(java.lang.String query)
Gets database results from an SQL query.boolean
writeData(java.lang.String query)
Performs INSERT, UPDATE and DELETE SQL queries.
-
-
-
Method Detail
-
readData
public java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> readData(java.lang.String query)
Gets database results from an SQL query. Normalizes the results in an associative structure. Normalizes data types as strings.- Specified by:
readData
in interfaceDataHandler
- Parameters:
query
- String The SQL query- Returns:
- ArrayList
-
writeData
public boolean writeData(java.lang.String query)
Performs INSERT, UPDATE and DELETE SQL queries.- Specified by:
writeData
in interfaceDataHandler
- Parameters:
query
- String The SQL query- Returns:
- Boolean
-
-