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 connecting to Remote Database 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 "connecting to Remote Database" Watch "connecting to Remote Database" New topic

connecting to Remote Database

Bindu Roshan

Joined: Apr 23, 2003
Posts: 3
I want my swing application connect to a remote database(MySQL) and return resultsets.
Now I am getting data directly from remote DB using
remote DbURL =jdbc:mysql://remote IP address:3306/dbname
DriverManager.getConnection(remotedbURL, remoteuserName, remotepassWord);
Is there any problem getting records like this?

What is the best way of doing this?

Is this through RMI?(any reference sites for Tomcat RMI)or any other way?

Thanks in advance.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Moving to JDBC

GenRocket - Experts at Building Test Data
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
You are doing it correctly: it doesn't matter if the database is local or remote, all you need is the IP address or domain name (and any other optional database parameters).

The java classes (JDBC libraries for the database) are talking either directly to the database, or through some sort of proxy. But it's not using RMI.
Bindu Roshan

Joined: Apr 23, 2003
Posts: 3
Thank you very much Wayne.
I agree. Here's the link:
subject: connecting to Remote Database
It's not a secret anymore!