i have designed a website using JSP and mysql, there is an enquiry form in that website ,when one fills the form the details automaticaly go into databse as the logic goes..but my problem is on localhost(tomcat) when i fill the form and submit, a retrieved form is displayed which shows my entry..but when i hosted the website the data is not being retrieved ...which means it is not geting connected to the server database which i created on putty.. can anyone please help me on this.i am new to jsp ..i just cannot get the logic.i mean on local host alls well but nt on the server..can anyone help step by step on this..please.
my website link is www.dcg.net.in
u can try and fill the form ..
it will give you a blank retrieved form..

you need to get the ip address of your remote server and then replace localhost with it in your connection url

String connectionURL = "jdbc:mysql://ip-address:3306/student";

This is how i have done the connection. Is it write.
Anything else is needed? I mean do i need to mention a username & password for Mysql as i had done for localhost? Below is the code :
connection = DriverManager.getConnection
(connectionURL, "root", "xxxxxx");

Make sure that your MySQL is actually externally accessible, many providers have it as local.
Make sure that you have JConnector.
If this still doesn't work don't forget to check servers logs.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.