Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Connect jsp & mySQL Remotely

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running a jsp page on this URL:
http://www.xyz.com/register.jsp
There is no database support available in www.xyz.com website.
I want my form data to be posted on another site:
http://www.abc.com/thankyou.jsp
In the www.abc.com 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.
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would be "jdbc:mysql://www.abc.com:3356/events". 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 www.abc.com, 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 ]
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paper beats rock. Scissors beats tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic