Connect to MySQL-database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • YarrOfDoom
    Recognized Expert Top Contributor
    • Aug 2007
    • 1243

    Connect to MySQL-database

    Hey there,
    Is it possible to let a java-applet read from and write to a mysql-database?
    Or should I find a way to work around this?

    Yarr
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by yarrofdoom
    Hey there,
    Is it possible to let a java-applet read from and write to a mysql-database?
    Or should I find a way to work around this?

    Yarr
    Why not use JSP/Servlet for this if you have a web application that you want to connect to the database.

    Comment

    • YarrOfDoom
      Recognized Expert Top Contributor
      • Aug 2007
      • 1243

      #3
      Originally posted by r035198x
      Why not use JSP/Servlet for this if you have a web application that you want to connect to the database.
      Because I don't now what that is :D

      Comment

      • YarrOfDoom
        Recognized Expert Top Contributor
        • Aug 2007
        • 1243

        #4
        I've looked it up and JSP isn't quite suitable for what I had in mind. If it helps: I'm trying to create an applet to display images of which the paths and displayed info are stored in a database. My applet would have some buttons, which if clicked will get the applet to get/store data from the database and renew the content of some of the displayed items. The thing is, I don't want the webpage to be reloaded every time a button is clicked.

        Yarr

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by yarrofdoom
          I've looked it up and JSP isn't quite suitable for what I had in mind. If it helps: I'm trying to create an applet to display images of which the paths and displayed info are stored in a database. My applet would have some buttons, which if clicked will get the applet to get/store data from the database and renew the content of some of the displayed items. The thing is, I don't want the webpage to be reloaded every time a button is clicked.

          Yarr
          All that can be done by JSPs of course with a bit of AJAX for the no reloading part.
          If you want to stick to applets, you'd need to note that by default applets do not have access to databases (security), so you'll need to sign your applet accordingly and give it access to the database. The rest of it is just playing around with JDBC.

          Comment

          • comando2929
            New Member
            • Nov 2007
            • 5

            #6
            I was tring something very similar a while back. I wanted a high score system for my Tetris but had a hell of a time tring a sign just a test applet. After a few days of struggling I ended up using a http connect function to a specific php page that would write the score into the database. I know, a little round about, but it works. Depending on how much activity you are panning on handling, something like that should work. An because it's not actualy a live connection to the database, signing is not necisary.

            Comment

            Working...