aspose file tools*
The moose likes JDBC and the fly likes Remote Access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Remote Access" Watch "Remote Access" New topic
Author

Remote Access

Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Is is possible to access the database(Mysql) which resides at www.xyz.com through a remote client. That is, can an application which DOES NOT reside on the server ( where the database is )can acess the database by specifying the following statements :
String url = "jdbc:mysql://ip of the site:3306/xxx?user=root&password=";
connection = DriverManager.getConnection(url);
Thanks in advance


Raghav.
Kevin Mukhar
Ranch Hand

Joined: Nov 28, 2000
Posts: 83
Originally posted by raghav mathur:
Is is possible to access the database(Mysql) which resides at www.xyz.com through a remote client. That is, can an application which DOES NOT reside on the server ( where the database is )can acess the database by specifying the following statements :
String url = "jdbc:mysql://ip of the site:3306/xxx?user=root&password=";
connection = DriverManager.getConnection(url);
Thanks in advance

Yes, as long as the owner of the database has given access privileges to the indicated user, coming from the given host. Since MySql allows one to use wild card hostnames when setting up privileges, it is indeed possible to allow root access from any client machine on the network. That is why the MySql documentation says that one of the first things you should do is give root a password and restrict access to the root account.
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Originally posted by Kevin Mukhar:

Yes, as long as the owner of the database has given access privileges to the indicated user, coming from the given host. Since MySql allows one to use wild card hostnames when setting up privileges, it is indeed possible to allow root access from any client machine on the network. That is why the MySql documentation says that one of the first things you should do is give root a password and restrict access to the root account.

I spoke to my administrator and what he told me that he has already given permission for clients accessing the database other than localhost.
Does he have to specify IPS individually ? to which he wants to give access to ?
I continue to get the following exception:
NoRouteToHostException
This is the exception which occurs when i change the DB user to "root" and when again change it to the actual original one , it gives me "Acess Denied"
According to the administrator he has set the permission for the database so that client besides localhost can access the database .
PLease help me out
Thanks in advance
[ July 01, 2003: Message edited by: raghav mathur ]
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Any Suggestions ?
Rema Remulta
Ranch Hand

Joined: Apr 03, 2002
Posts: 51
hello,
Just got the same problem but this is with MS Access. How to connect the MS Access db file on a remote network?
Thanks,
Rema
Rema Remulta
Ranch Hand

Joined: Apr 03, 2002
Posts: 51
hello,
Got the same problem but this is with MS Access. Have to do remote accessing of database file, what are the right syntax or code when including the ip address of the machine where the file is stored? Normally, if it's not accessing on remote, the url is url="jdbc dbc RIVER={Microsoft Access Driver (*.mdb)};DBQ="mydb.mdb";
Some hints?
Cheers,
Rema
Rema Remulta
Ranch Hand

Joined: Apr 03, 2002
Posts: 51
hello,
Got the same problem but this is with MS Access. Have to do remote accessing of database file, what are the right syntax or code when including the ip address of the machine where the file is stored? Normally, if it's not accessing on remote, the url is url="jdbc dbc RIVER={Microsoft Access Driver (*.mdb)};DBQ="mydb.mdb";
Some hints?
Cheers,
Rema
Rema Remulta
Ranch Hand

Joined: Apr 03, 2002
Posts: 51
hello,
Got the same problem but this is with MS Access. Have to connect to the db file that resides in the other machine in a network. Normally, when the database access isn't done on a remote, the url is url="jdbc dbc RIVER={Microsoft Access Driver (*.mdb)};DBQ="mydb.mdb"; So what would be the parameters then when connecting on a remote? Some hints?
Thanks,
Rema
Rema Remulta
Ranch Hand

Joined: Apr 03, 2002
Posts: 51
hello,
Got the same problem but this is with MS Access. Have to connect to the db file that resides in the other machine in a network. Normally, when the database access isn't done on a remote, the url is url="jdbc dbc RIVER={Microsoft Access Driver (*.mdb)};DBQ="mydb.mdb"; So what would be the parameters then when connecting on a remote? Some hints?
Thanks,
Rema
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remote Access