Here's the code which is throwing the exception: First you set the variable ps to null. You don't have any code which assigns anything else to it, and then you try to call its executeQuery method. So you get a NullPointerException.
You shouldn't be putting this sort of code in a JSP. And you shouldn't be using a JSP as a test harness for the code either, because (as you can see) you don't get to see the exceptions properly. So stop doing that. Just write some plain old Java code to test your database accessing. Once you have it working, then put it back into a web application. (But preferably not into a JSP. Putting database code in a JSP hasn't been a best practice for several years now.)