refactoring

if to change this file this way it may looks better
LOOKS!!! I didn't run your code same as mine, coded it in web, so no errors check. Be patient, I made it just to show how it can be changed, not as perfect example. I MAY EVEN DOES NOT COMPILE!!!
1. More understanding on what is happening in main.
2. Fixed problems with streams closing
3. Now, you can separate Database Management logic into another file to clear your code and share it with other for codevelopment
4. read more about how to close streams, and this: http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html
5. Hope it helps you, good luck, have fun!