File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Connect jsp & mySQL Remotely Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Connect jsp & mySQL Remotely" Watch "Connect jsp & mySQL Remotely" New topic

Connect jsp & mySQL Remotely

Deep India

Joined: Jun 17, 2002
Posts: 5
I am running a jsp page on this URL:
There is no database support available in website.
I want my form data to be posted on another site:
In the site I have support for both JSP and mySQL.
If this scenario is possieble then what will be the jsp connectivity script for the following:
String username = "abc_mysql_database_username";
String password = "abc_mysql_database_password";
String url= "jdbc:mysql://localhost:3356/events";
In place of localhost what to give. "events" is the name of the database.
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
That would be "jdbc:mysql://". But no responsible hosting provider would let their firewall expose the database to the outside world like that. Try, but don't be surprised if you cannot get a connection.
What you can do is, on, expose your database functionality as some sort of service accessible over HTTP. This can be RMI tunneled over HTTP, an XML-RPC service, a Web service, or some other HTTP-based service of your own design. You will have to think through the security implications of this, though, especially if you don't have SSL/TLS (HTTPS) support.
- Peter
[ April 09, 2003: Message edited by: Peter den Haan ]
Amit Shanker

Joined: Mar 08, 2003
Posts: 23
Just using HTTP GET or HTTP POST will be sufficient for you. You can use hidden form variables for your data. On submit() click of your form, redirect to the url you want to post the data.
I agree. Here's the link:
subject: Connect jsp & mySQL Remotely
It's not a secret anymore!