After you have made those changes to your code, here are your mistakes.
You don't close anything!!!! You must close whatever you open. In order to do that you need to close them in a finally block to make sure that they are always closed:

finally {
con.close();
s.close(); // the statement
}

But since those are declared inside the try the above code will not work because they are not visible outside it. Also the close operation also throws an exception so you need to put that in a try-catch as well:

In the finally you close what you opened.
You used the try-catch in the finally: try { ... } catch (Exception e){} Because the close operation also throws an exception and you need to catch that as well. But you don't need to handle it so the catch is empty.

You check if they are null: if (st!=null) st.close(); because if something goes wrong, they might not take value in the try, since they are declared null outside the try. They cannot be initialized outside the try because that would throw an exception. So they are declared outside, initialized inside the try and in the finally you close them only if the are not null, meaning if they have been "opened" (initialized)

EDIT: The query also needs to change. It must be like this: VALUES "+"('"+ user +"NOT:VALUES "+"(' "+ user +" Check the empty space, when you print it. Otherwise instead of saving this in the DB: "Brandon", you would be saving this: " Brandon "
Better have it like this: String query = "INSERT INTO Final (candidate, marks) VALUES ('" + user + "' , '" + m1 + "')";