Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-2007, 08:29 AM
Member
 
Join Date: Jun 2007
Posts: 95
Felissa is on a distinguished road
Connect applet with mysql
Well, what I'm wondering is how I could have an applet on a website which could query a MySQL database local on the server.

I appreciate that this may not be the most secure thing in the world as Java can be dissassebled quite easily if you want to, but I'm not too worried about that as of the moment, I'm more interested in "is it possible" and "how would this affect the end-user".

Also, I'm quite interested in using java for TCP connections with other applications and how I could set up a connection and send simple data between them.

Thanks

Felissa
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-04-2007, 08:33 AM
Senior Member
 
Join Date: Jun 2007
Posts: 111
Eric is on a distinguished road
Java has the ability to connect to and query a database provided you have the proper driver for that database platform. I've personally only done this with DB2. Here is an example I googled that shows an applet connecting to and querying an Oracle database

So provided there is a driver for MySql then you should be able to connect and query your database.

And a nice article on how to set up and use, with sample java source code near the bottom of the page.

I'll be honest, I don't know whether the driver needs to be installed Client side or Server side or both. However, since it's an applet that's not running on client machines, I think you'll be ok.

Greetings

Eric
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-04-2007, 08:35 AM
Member
 
Join Date: Jun 2007
Posts: 92
Daniel is on a distinguished road
You create an applet that pulls contents from your website via HTTP calls and the response would be in xml data format.

Your applet then processes the xml data and renders the contents inside it as html or how ever you which to display the contents.

If you use this approach, then you don't have to worry about jdbc unless your website runs on JSP/Servlet technology.

In other words, you can use PHP/ASP/ASP.NET/Perl/Ruby on Rails etc...to connect to your database...generate xml data...and then render the contents in your applet.
This approach is used by Flash developers...and has been tested...and works like a charm.

Greetings
Daniel
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-05-2007, 07:26 PM
Member
 
Join Date: Jul 2007
Posts: 2
JToolTip is on a distinguished road
Quote:
Originally Posted by Daniel View Post
You create an applet that pulls contents from your website via HTTP calls and the response would be in xml data format.

Your applet then processes the xml data and renders the contents inside it as html or how ever you which to display the contents.

If you use this approach, then you don't have to worry about jdbc unless your website runs on JSP/Servlet technology.

In other words, you can use PHP/ASP/ASP.NET/Perl/Ruby on Rails etc...to connect to your database...generate xml data...and then render the contents in your applet.
This approach is used by Flash developers...and has been tested...and works like a charm.

Greetings
Daniel
CLEVER! good job.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
connect two applet dg_iiita Java Applets 0 02-15-2008 02:59 PM
Connect applet with mysql baltimore Java Applets 1 08-07-2007 07:39 AM
connect to MSDE leonard Database 1 08-06-2007 05:37 PM
connect to microsoft access bbq Database 1 07-09-2007 04:33 AM
Applet, To center text and To open I engage in a dialog in an Applet Marcus Java Applets 4 06-08-2007 07:15 AM


All times are GMT +3. The time now is 07:12 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org