VDS Sphera Knowledge Base
How do I connect to MySQL from a JSP page?
|
MySQL JDBC JSP Example on Sphera Tomcat
-
Copy mysql-connector-java-3.0.8-stable-bin.jar to your /var/tomcat/common/lib Directory
-
Restart Tomcat from the command line using ssh with:
/etc/rc.d/init.d/apachectl restart
-
Make sure that you have enabled remote access for your MySQL database. (This requires an IP address)
-
Copy this code to a file named mysqljdbc.jsp in your /var/tomcat4/webapps/hw Directory. Be sure to replace IP_ADDRESS with your Database's External IP address. For this example you will need to add a table to your test database named "foo".
-
Call your jsp page from within a web browser like: http://www.yourdomain.com/hd/mysqljdbc.jsp
User Comments
| How do I connect to MySQL from a JSP page? |
|
| There are no user comments for this topic. |
|
| |
|
Attachments
Related Articles