4 Replies Latest reply: Apr 16, 2009 4:17 AM by 793415 RSS

    Include MySQL Connector in JAR

    807588
      Is there a way to somehow include the MySQL connector in one of my JARs so that a user does not have to have two JARs in one folder for one program to run? Like, instead of having ThisJAR.jar AND MySQL_Connector.jar in one folder for ThisJAR to use MySQL_Connector for a database connection, I just want ThisJAR.jar.

      I think I made that as confusing as it could possibly be. :-P

      Thanks in advance,
      Zach

      Edited by: Zach on Apr 15, 2009 6:53 PM
        • 1. Re: Include MySQL Connector in JAR
          baftos
          Explode the two jars in the same folder, than remake a single jar out of them. Test. If it works (I guess it should), the problem is solved. Now just make sure that the MySQL license agreement allows this.
          • 2. Re: Include MySQL Connector in JAR
            DrClap
            I know you said why you wanted everything in one jar, but why don't you want the user to have two jars in the folder? It's not like that would inconvenience the user in any way.
            • 3. Re: Include MySQL Connector in JAR
              794069
              I'm very sure that what you are trying to achieve is against the licence agreement.

              Also MySQL is not a free application when used as an embedded database.
              • 4. Re: Include MySQL Connector in JAR
                793415
                >
                Is there a way to somehow include the MySQL connector in one of my JARs so that a user does not have to have two JARs in one folder for one program to run? >
                If you want to make it simple for the end-user, and your app. has a GUI, deploy it using webstart.

                A single link can take them to the 'download' page that uses [deployJava.js|http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html] to check a suitable minimum version of Java is available before inserting the link to the launch/install file. If the user 'follows the prompts' from there, they might end up with a single menu item to launch the app., and no visible Jars.

                I provide some [examples of the webstart API|http://pscode.org/jws/api.html] that show some services available to apps. launched using webstart, of particular use for your project might be the ExtensionInstallerService to install the DB, and the PersistenceService to store the path the user chose to install it (you would offer them the choice, of course).

                Java webstart also offers other nice features like splash screens, icons..

                Again, check the licensing arrangements - you might show the MySql license when installing.