Closed ScottCTD closed 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!
DatabaseGateway.getUserData(String)
could returnnull
if the given user does not exist in the database.RuntimeException
, which is not very cool.getBillData
method may returnnull
if the table related to the given id is not in the database, instead of throwing aSQLException
.