Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / September 2005

Tip: Looking for answers? Try searching our database.

url to connect an applet to mysql on a virtual hosting environment

Thread view: 
Francois - 13 Sep 2005 10:30 GMT
Hi
I can't connect to a mysql db with an applet and J-Connector although
the applet is on the same server (from my point of view).

I suspect the problem is that we are using a virtual hosting server.
I have tried url like
jdbc:mysql://www.aviron-vevey.ch:3306/DB_name
jdbc:mysql://localhost:3306/www.aviron-vevey.ch/DB_name
jdbc:mysql://localhost:3306/DB_name
jdbc:mysql://213.242.101.162:3306/DB_name
jdbc:mysql://box1.swiss-online.com:3306/DB_name

... but all I get is connection timed out or access.denied.

The same applet with LAMPP on my pc work without problem.

Is there anyone here who could help me ?

TIA

Francois
John Currier - 13 Sep 2005 19:08 GMT
> I can't connect to a mysql db with an applet and J-Connector although
> the applet is on the same server (from my point of view).

Applets don't typically run on the same machine as a database or web
server.  They run on the machine that's running the browser.

Just making sure that you're clear on that,
John
http://schemaspy.sourceforge.net
Francois - 14 Sep 2005 07:06 GMT
OK, what I mean is "my applet should be able to make a connection to
the database, since (I believe) it comes from the same host  as the
database". I know that it runs on the pc where the browser is.

Francois
John Currier - 15 Sep 2005 03:29 GMT
How about something like this:

conn = DriverManager.getConnection("jdbc:mysql://" +
applet.getCodeBase().getHost() + ":3306/DB_name", dbUsername,
dbPassword);

John
http://schemaspy.sourceforge.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.