aspose file tools*
The moose likes JDBC and the fly likes How to access a database over a network Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to access a database over a network" Watch "How to access a database over a network" New topic
Author

How to access a database over a network

Varun Nambuthiri
Ranch Hand

Joined: Sep 20, 2010
Posts: 76
Hi ,

I need help regarding an issue . I need to be able to access a database located in another system in the same network . I tried using the following code

And the error which it shows is " Cannot get hostname for your address "

Thanks in advance


All's well that Debugs well .
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

can you ping the IP address from your machine

http://www.mymommybiz.com/seo/howtoping.html
Varun Nambuthiri
Ranch Hand

Joined: Sep 20, 2010
Posts: 76
Yes I can .. and its successful ... I can access the database using "phpmyadmin" . So why cant I access the DB ?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19753
    
  20

Is phpMyAdmin running on a web server on the same machine as the MySQL server? By default, MySQL is setup to not allow connections from outside the machine itself. One column in the user table is the machine the user can come from. Check out step 5 of this page on how to grant access to update this.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Varun Nambuthiri
Ranch Hand

Joined: Sep 20, 2010
Posts: 76
Thanks

But the thing is have granted the access to the particular DB but still cannot access it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to access a database over a network