Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> What Is My Mysql Url (connecting Through Java/jdbc)
sparkx
post Jun 14 2008, 07:08 PM
Post #1


Sparkx
Group Icon

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
Go to the top of the page
 
+Quote Post
Darasen
post Jun 14 2008, 10:48 PM
Post #2


Advanced Member
Group Icon

Group: [HOSTED]
Posts: 131
Joined: 3-April 08
From: Milling about
Member No.: 29,596



QUOTE(sparkx @ Jun 14 2008, 03:08 PM) *
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.

Go to the top of the page
 
+Quote Post
sparkx
post Jun 15 2008, 01:02 AM
Post #3


Sparkx
Group Icon

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
Go to the top of the page
 
+Quote Post
Atomic0
post Jun 15 2008, 05:10 AM
Post #4


Advanced Member
Group Icon

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
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Jun 17 2008, 06:40 AM
Post #5


PsYcheDeLiC dR3aMeR
Group Icon

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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. What To Look From A Java Hosting Service Provider(1)
  2. Free Mysql Server Sites(9)
  3. Mysql Problem(0)
  4. Mysql With My Own Server(4)


 



- Lo-Fi Version Time is now: 30th August 2008 - 07:34 AM