JSP HelpJSP Page Placement
JSP pages can be put under public_html folder or under any sub directory in the public_html folder.
JavaBeans and Classes Placement
Your JavaBeans and Classes should be packaged and put under public_html -> WEB-INF -> classes -> YourPackageName.
If you don't package your Java codes, it may not work.
Database Creation and Connection
Before you connect to your database, you need to create a database from your control panel's MySQL. On this server, your database name looks like YourUserName_DBName. So, if your control panel username is "itsme" and you give the DB name "MyDB" from control panel, it will be referred to as "itsme_MyDB". When you refer to your database from JSP or Servlet, you should refer your database as "itsme_MyDB" instead of "MyDB".
Driver and Connection Strings
Driver and connection strings should be as follows:
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost/<Your DB Name Here>";
You should also specify your user name and password. The default username and password are the ones you use for your control panel.
You can use the following JSP code to test your DB connection. You just need to replace the database name, username and password with your own. Put this page under public_html. Again, before you test it, you have to make sure you have the driver .jar file in the above mentioned lib folder.
<%@ page import="java.sql.*" %>
// the "url" to our DB, the last part is the name of the DB
// the default DB username and password may be the same as your
control panel login
Statement stat = con.createStatement();
| HOME | FEATURES | FAQs | SUPPORT | HELP | PRIVACY STATEMENT | ABOUT US | TERMS OF SERVICE |
© Copyright 2004-2009 DataBoy