Solution :
I was going through your code which you have posted in your question after going through your jdbc url, I have found the cause behind your error.
localhost:1200/xe should be changed to localhost:1200:xe if xe is your SID for the database.
So please change below code from
connect = DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1200/xe", "scott", "tiger");
To the following code.
connect = DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1200:xe", "scott", "tiger");
This will fix all the errors.