One important distinction.
Netbeans is an
IDE (Integrated development environment), not a container.
Netbeans has an embedded version of
Tomcat inside it and yes you can certainly connect to a MySql database with it.
My personal recommendation is that you put the IDE aside while learning JSP and servlets. Once you can install and configure Tomcat (or any other spec compliant container), write, compile, and deploy an app with a text editor, and command line compiler, then, shop around to see if any of the available IDEs will speed up development for you.
If you wish to continue learning with Netbeans, let me know and I'll move this to our IDEs forum where someone should be able to point you in the right direction for getting a connection to Mysql. If not, let me know and I'll move this to our Apache Tomcat forum for you.
In either case, we should be able to get you up and running in a short amount of time.