To be honest, there's so much wrong that forums aren't going to be much help. You should probably see if you can find someone in your area that's willing to mentor a new developer. See if there are any Java usergroups in your area, if there are visit and see if you can find someone willing to help.
Do some reading:
Security basics (the OWASP top 10 on pluralsight's good)
Good password management, there's also a good course on pluralsight
Good Java coding practices. Dumping everything into main is not good practice
As for their being data in Stocks, that's half of problem. You're pulling the entire contents of the table across to see if there's a single row. Imagine what would happen if there were 100 000 000 rows in that table.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability