Package CIserver.app
Class SQLhandler
java.lang.Object
CIserver.app.SQLhandler
This class handles all communication with the database for
insertions, deletions and retrieval of builds
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a SQLhandler that opens a connection to the file buildHistory.db. -
Method Summary
Modifier and TypeMethodDescriptionMethod to retrieve build history for a specific commit ID from the database.Method to retrieve entire build history from the database.voidinsertEntry(String commitId, String buildDate, String buildLogs) Method to insert a new build history entry into the database
-
Constructor Details
-
SQLhandler
public SQLhandler()Instantiate a SQLhandler that opens a connection to the file buildHistory.db. If the file does not exist, it creates a file named buildHistory.db If the table BuildHistory does not exist in the file, create it.
-
-
Method Details
-
insertEntry
Method to insert a new build history entry into the database- Parameters:
commitId- The commit ID of the build history entrybuildDate- The build date of the build history entrybuildLogs- The build logs of the build history entry- Throws:
SQLException- If an SQL exception occurs
-
getEntry
Method to retrieve build history for a specific commit ID from the database.- Parameters:
commitId- The commit ID for which to retrieve build history- Returns:
- An array containing the build date and build logs for the given commit ID, or null if no build history is found for the commit ID
- Throws:
SQLException- If an SQL exception occurs
-
getHistory
Method to retrieve entire build history from the database.- Returns:
- An array containing the build date and build logs for the given commit ID, or null if no build history is found for the commit ID
- Throws:
SQLException- If an SQL exception occurs
-