CSC207-2022F-UofT / course-project-bill-gates

A bill recording software developed by team "Bill Gates."
9 stars 4 forks source link

[Improvement] Return values of methods in `DatabaseGateway` could be useful. #59

Closed ScottCTD closed 1 year ago

ScottCTD commented 1 year ago
Lei-Tin commented 1 year ago

I have a small problem.

If we were to select users and entry, that is fine. We can return null if the username / entry_id in question cannot be found. As the query ResultSet will be empty.

However, for other "Getter" methods from the database, if we pass in a table ID that is not quite right, MySQL gives a SQLException right away, and there is no way to tell whether this SQLException is actually caused by a wrong table ID or simply a bad connection.

Similar result goes for createBillTable and methods that aren't specific to grab a single result.

Also, aside from this, in my next PR, I will also include a SQL Script to generate a sample dataset that we can use to test things. Stay tuned for that!