Ok so I managed to solve the issue. It turns out that I am an idiot.
The url I was using was "jdbc:mysql://192.168.56.1:3306/my_database"
The actual IP address shown on MySQL workbench for the server is 192.168.1.60
I have no idea how the program was even connecting to the database when it was given the wrong IP address, but when I corrected it, my program was connecting instantly and returning all queries straight away!
Thank you for trying to help, guys. For the future, if you see me posting about a problem I am having, just tell me I'm an idiot and you will most likely be correct!