Results 1 to 20 of 20

Thread: Applet & sql

  1. #1
    gan5016 is offline Member
    Join Date
    Aug 2009
    Posts
    18
    Rep Power
    0

    Default Applet & sql

    I almost killed by applet, why there are so many limitation of applet compare to the java application?
    I stuck with the applet which able to retrieve the info from sql that i already done in the java application.Is there any security matter that need to take note while connect the java applet and sql...
    :confused:

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  3. #3
    gan5016 is offline Member
    Join Date
    Aug 2009
    Posts
    18
    Rep Power
    0

    Default

    is it a must to sign the applet to enable the permision so that the applet able to retrieve the sql information????

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Yes. Perhaps you should consider not using Applets for whatever it is that you are doing.

  5. #5
    gan5016 is offline Member
    Join Date
    Aug 2009
    Posts
    18
    Rep Power
    0

    Default

    Sorry for being so stupid.:( Then is there any alternate way that can redirect the sql output to applet?bcos other then retrieve data, i need to process some kind of calculation to get result,I already write the code in applet.

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Perhaps you should create a web application instead using JAVA EE technologies.

  7. #7
    gan5016 is offline Member
    Join Date
    Aug 2009
    Posts
    18
    Rep Power
    0

    Default

    Wat do you mean by web application?any simple example for reference??thanks

  8. #8
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Google is your friend here. A simple application involving Servlets and perhaps JSPs served by a Web container.

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by gan5016 View Post
    Wat do you mean by web application?any simple example for reference??thanks
    Basically we have two types of applications. Web applications and desktop/windows applications. And many more categorization as well. Actually based on different pros/cons we came across with these types. As the name implies to you, to deal with the web. You can use large number of technologies to work on with the web. JSP one of them related with Java.

  10. #10
    gan5016 is offline Member
    Join Date
    Aug 2009
    Posts
    18
    Rep Power
    0

    Default

    I really new to all these, :( all are the term that i cant relly understand,actually we doing a group project, my friend able to retrieve the information from SQL thru the jsp and display with tomcat.but i need to do some processing of the data retrievied,so now the problem is how to transfer the data from jsp to applet?help.....

  11. #11
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Don't retrieve data from the database inside a JSP. Do it in a separate Java class. Use the JSP for presentation only.
    Why do you need to send the data to an Applet? Why not just display the data on a JSP?

  12. #12
    gan5016 is offline Member
    Join Date
    Aug 2009
    Posts
    18
    Rep Power
    0

    Default

    Actually for my project right, instead of display a raw data extract from database, i need to do some calculation and display the final result,like example i retrieve population information from the database, user insert some parameter and the process the data and display the result.I dun really good in explaining hope you understand wat i mean..:)

  13. #13
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Right then so you need the following:
    1.) A class (or layer) that gets data from the database.
    2.) A JSP where you display the data from the database and allow the user to enter additional information before submitting to a servlet.
    3.) A servlet that receives all the information entered by the user.
    4.) A class that has methods for doing the calculations. This class can call methods from the data retrieving class if it needs to.
    5.) Another JSP for displaying the results of the calculations.

  14. #14
    gan5016 is offline Member
    Join Date
    Aug 2009
    Posts
    18
    Rep Power
    0

    Default

    why should use a servlet?and the calculation methods is it can jus write in java application and call the application to process the data?And a class to get the database,what is the class means??heehee sorry really got no idea integrate things of different platform.

  15. #15
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Let's take a few steps back? Why did you have an applet in first place? Do you want your application to run on a web browser or as a normal Java application?

  16. #16
    gan5016 is offline Member
    Join Date
    Aug 2009
    Posts
    18
    Rep Power
    0

    Default

    I create a website which contain some application for the user to process some data that retreive from my database and return the result for user to do some analysis
    sorry to trouble you, really appreciate that!!!

  17. #17
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    So if you are creating a website using Java technologies then one approach is to go the route I suggested above. Just follow those steps.
    The reason why you need a servlet is bacause the user has to enter the values on a form in a web page and submit it to the server where you can process the values.
    The class that gets database values is a standalone class which knows nothing about JSPs or applets. All it knows is how to get data from a database and return it as an object or a list of objects.
    The idea is to separate the parts of the application that perform different tasks so that they become easier to develop and test.

  18. #18
    gan5016 is offline Member
    Join Date
    Aug 2009
    Posts
    18
    Rep Power
    0

    Default

    so is tat means i can sent the data back to server and process it, eg a user sent " 1,2,3,4,and 5" to the server,thare is a class that will receive the data 1,2,3,4,5 and do addition and return 15 to the user?sorry i only know how to explain in a stupid way.
    And if you dun mind how to sent the data to the class to process?
    is it javascript?

  19. #19
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Yes, just read through the steps I posted in reply #13 and follow them.

    P.S You need to get hold of a good web programming tutorial. Sun's Java EE tutorial is nice.

  20. #20
    gan5016 is offline Member
    Join Date
    Aug 2009
    Posts
    18
    Rep Power
    0

Similar Threads

  1. 3D Applet
    By DzzD in forum Java Applets
    Replies: 1
    Last Post: 03-30-2009, 11:20 PM
  2. Calling another applet on click of button in one applet
    By niteshwar.bhardwaj in forum Java 2D
    Replies: 1
    Last Post: 02-19-2009, 12:54 PM
  3. Need with an applet
    By maggie_2 in forum Java Applets
    Replies: 6
    Last Post: 09-21-2008, 08:07 PM
  4. First Applet HELP????
    By nvidia in forum New To Java
    Replies: 0
    Last Post: 08-13-2007, 10:11 PM
  5. Replies: 4
    Last Post: 06-08-2007, 06:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •