Hi, I just starting off using JSP and I was wondering if someone could help me. I am trying to connect to a database called test and retrieve information from the clubname column in the clubs table. Can anyone help as I am at my witts end.
Well, a bad practice code to connect database on a JSP page can be foundat this link. [ April 08, 2008: Message edited by: Anubhav Anand ]
As i said I am kinda new at this. I am doing a comparison between JSP and PHP and I am building 2 simple website that access mysql. I don't really know much about JSP although I know PHP. I am using Netbeans to make the application. I have MySQL installed on the computer will Netbeans be able to access that??
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.
Originally posted by Ben Souther: this question will do better in our IDEs forum.
Well, you connect to a database in Netbeans exactly the same way you do in Eclipse, and exactly the same way you would do if you were using Notepad to create your JSP. It's really a JDBC question. But it would be cruel to move it yet again, so I will let it languish here.
Have a look on the Internet for JDBC tutorials, though.
Originally posted by Paul Clapham: Well, you connect to a database in Netbeans exactly the same way you do in Eclipse, and exactly the same way you would do if you were using Notepad to create your JSP.
Not necessarily. Web containers (Tomcat anyway) look for classes in a specific set of directories instead of from the classpath environment variable. In a standalone install of Tomcat, the drivers libs need to go in one of a few possible directories (this is more specific if you're using container managed connection pooling). If he were using Tomcat as a standalone, I could have helped him with this. Netbeans uses an embedded version of Tomcat and, since I'm not sure how you set up a web development environment in Netbeans, so... I sent it here hoping that someone who's done this before can point him in the right direction. [ April 08, 2008: Message edited by: Ben Souther ]