I have a java applet on my website and i need it to connect to my mysql database. When I was trying to figure out how to do this i saw several examples that used jdbc. I'm confused can I use this to connect to my mysql data base at mysql.mysite.com. I am using a web hosting service(dreamhost) for my website. The line that is confusing me the most is

String url = "jdbc:mySubprotocol:myDataSource";

Recommended Answers

All 2 Replies

url = "jdbc:mysql:ipaddress/databasename"
should work
remember that the mysql server should be running from same server as the applet, else i might give some policy errors

Dear,

Applets are designed for rich-client application. So with default implementation of applet, you can't add IO and database operations.

But, to do so, you have to create security sub-class and policy.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.