   [web] MySQL and Java
  Hi,do you know some good tutorials on using Java and JSP with Tomcat and MySQL?I want to write a simple application that runs on the server and allows access to db using a web browser. I've got Tomcat set up and have a remote db on freesql.org. Now I need to know how to connect to db and how to generate jsp to access it.Thanks in advance   
  Do you have to use JSP, could you not use PHP?   ;Quote:Original post by DaveDo you have to use JSP, could you not use PHP?I have to :-( I know php is easier. I have to use Java and JSP.   ;  Moving to Web Development.   ;  Second hit in Google for "jsp tomcat mysql": http://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html#MYSQL.Quote:I have to :-( I know php is easier. I have to use Java and JSP.Why? Just pick a different webhost. And do yourself a favour, pick one where the database is on the same machine (or at least in the same local LAN) as the webserver. Moving webhosts is trivial.   ;  I'm doing it on a local computer. I don't want to make it public. I wanted to use PostgreSQL but can't install it, because I don't have NTFS. However, I have a MySQL database on freesql.org that I want to use.   ;  If you're on a local computer, wjy not install PHP and MySQL there?   ;Quote:Original post by SanderIf you're on a local computer, wjy not install PHP and MySQL there?Because it has to be done in Java and JSP, period.I don't want to trash my computer with DB servers, I want to use a remote one.   ;  I've had a JSP class a year ago - it's really a pain in the ass to work with. But if you want to use it, here's a tutorial. To use MySQL from JSP you need to have the appropriate JDBC driver installed for your version of MySQL. If I remember correctly, you can drop the MySQL Connector/J jar into Tomcat's classpath and you'll be good to go.   ;  Personally, I'd use Java servlets over JSPs.  They tend to be better structured, and IDEs see them as normal Java files.Depending on how deep you want to go, you can look into beans as a way for your servlets to do all the heavy lifting, and the bean would pass your output back down to the JSPs for rendering.  This configuration leaves your JSPs holding all the HTML and just enough Java code to pull the bean fields.   