Nov 22, 2009

What Is My Mysql Url (connecting Through Java/jdbc)

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Internet and Websites

What Is My Mysql Url (connecting Through Java/jdbc)

sparkx
 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

Comment/Reply (w/o sign-up)

Darasen
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.

 

 

 


Comment/Reply (w/o sign-up)

sparkx
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

Comment/Reply (w/o sign-up)

Atomic0
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.

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
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.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)


See Also,

*SIMILAR VIDEOS*
Searching Video's for mysql, url
advertisement



What Is My Mysql Url (connecting Through Java/jdbc)

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com