|
|
|
|
![]() ![]() |
Jun 14 2008, 07:08 PM
Post
#1
|
|
|
Sparkx Group: [HOSTED] Posts: 340 Joined: 11-October 06 From: Dana Point, CA, USA Member No.: 16,496 |
I have been working on a java applet that requires access to a MySQL database. I have been receiving an error. When I run the file my applet tries to access the user’s database not my server's database! I was using the mysql:localhost/database... method just like in PHP but apparently localhost doesn't mean the same think in Java. Seems funny but I need to know the location (URL) to the MySQL databases on Astahost. I am on the Gamma server if that makes a difference.
Thanks, Sparkx |
|
|
|
Jun 14 2008, 10:48 PM
Post
#2
|
|
|
Advanced Member Group: [HOSTED] Posts: 131 Joined: 3-April 08 From: Milling about Member No.: 29,596 |
I have been working on a java applet that requires access to a MySQL database. I have been receiving an error. When I run the file my applet tries to access the user’s database not my server's database! I was using the mysql:localhost/database... method just like in PHP but apparently localhost doesn't mean the same think in Java. Seems funny but I need to know the location (URL) to the MySQL databases on Astahost. I am on the Gamma server if that makes a difference. Thanks, Sparkx Just for future reference they do mean the same thing the difference lies in where the code is being executed. With PHP the code is being ran by the server hence the server is the local host. With Java the code is being executed client side thus localhost is going to be the users machine. |
|
|
|
Jun 15 2008, 01:02 AM
Post
#3
|
|
|
Sparkx Group: [HOSTED] Posts: 340 Joined: 11-October 06 From: Dana Point, CA, USA Member No.: 16,496 |
That was just a phrase to keep my post shorter and more to the point. Localhost in PHP means the server IP and localhost for java means the client's IP. I am quite aware of the basics of JDBC and PHP in MySQL. I simply need to know the URL to my MySQL server. This is just one of the things that I don't like about the new Cpanel (Cpanel X). The old one told how to connect to each individual database.
Thanks, Sparkx |
|
|
|
Jun 15 2008, 05:10 AM
Post
#4
|
|
|
Advanced Member Group: [HOSTED] Posts: 134 Joined: 18-March 07 Member No.: 20,937 |
I suppose since your hosted with Astahost, you are referring to the MySQL server connected with the server hosting the free Astahost hosting account. The IP address of the MySQL server should be the same as the IP address for access to cPanel (e.g. if your cPanel is hosted on http://208.87.243.146:2082/, then the MySQL server is also at 208.87.243.146). Try and see if that works.
Update: I just checked phpMyAdmin which refers to the MySQL server as localhost. Therefore, it is highly likely the MySQL is also hosted on the same server as the cPanel. This post has been edited by Atomic0: Jun 15 2008, 05:14 AM |
|
|
|
Jun 17 2008, 06:40 AM
Post
#5
|
|
|
PsYcheDeLiC dR3aMeR Group: Admin Posts: 2,242 Joined: 29-January 05 From: Nakorn Chaisri, Thailand Member No.: 2,411 |
Instead of connecting through an IP, why don't you use your own sub-domain name ? That'd make the connection URI absolute and avoid any of the localhost confusion.
|
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 30th August 2008 - 07:34 AM |