Results 1 to 6 of 6
  1. #1
    bodylojohn is offline Member
    Join Date
    Nov 2013
    Posts
    37
    Rep Power
    0

    Default Runnable jar doenst show data from database

    Hello,

    I am still working on my java course and now we have to create a jar file from a previous project (this is a project where a connection to the database is made and data is shown in a frame).
    When I follow the instruction in my course material I don't get it to work.

    I've tried the following:
    1. Open eclipse on windows xp
    2. Right click on the project folder in eclipse
    3. Click on "export" in the menu that appears
    4. Choose "runnable jar"
    5. click next
    6. I insert the following parameters:
    - Launch configuration --> I select my main class
    - export destination --> I select the folder D:\
    - library handling --> Package required libraries into generated jar
    7. click Finnish

    This is what happens when I dbl click the jarfile (wampserver is running):
    1. I get an error: "SQL ERROR: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has nog recieved any packets from the server."
    2. I click ok on the message and the following message appears: "SQL Error: null"
    3. I click ok on this message and the frame with the fields appears without data from the database.

    I hope that I can figure out what the problem is.

    This is a crosspost to: http://www.javaprogrammingforums.com...tml#post142077
    Last edited by bodylojohn; 03-13-2014 at 07:51 AM.

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,900
    Rep Power
    5

    Default Re: Runnable jar doenst show data from database

    the driver is telling you: I'm trying to talk to the database, but its not answering. This is likely trouble with the database or the network setup, not with the code.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    bodylojohn is offline Member
    Join Date
    Nov 2013
    Posts
    37
    Rep Power
    0

    Default Re: Runnable jar doenst show data from database

    @gimbal2....

    When I run the code in eclipse on the same machine everything works fine.
    Could it be THE mysql-connector-java-5.1.13-bin.jar?

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,900
    Rep Power
    5

    Default Re: Runnable jar doenst show data from database

    maybe, its very old. I kind of doubt it though. I would rather check your Eclipse settings if there are not magical proxy settings in there or something.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    bodylojohn is offline Member
    Join Date
    Nov 2013
    Posts
    37
    Rep Power
    0

    Default Re: Runnable jar doenst show data from database

    @gimbal2....

    I installed eclipse and did not change anything in the settings.

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,900
    Rep Power
    5

    Default Re: Runnable jar doenst show data from database

    Yes well - can't help you with your system setup problems, I don't have access to it. I hope you can figure it out.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. How to use data from obtainMessage in Runnable?
    By iceman999 in forum Android
    Replies: 0
    Last Post: 02-06-2013, 05:54 PM
  2. Show data from PostgreSQL
    By kike_skate in forum New To Java
    Replies: 5
    Last Post: 05-18-2011, 08:06 PM
  3. How to Autogenerate of ID from database and show on JSP page?
    By gurpreet.singh in forum JavaServer Pages (JSP) and JSTL
    Replies: 9
    Last Post: 03-28-2011, 09:28 AM
  4. How to show class initialize data in JSP ?
    By tking88 in forum New To Java
    Replies: 0
    Last Post: 03-07-2010, 09:17 AM
  5. Data from a model class won't show up in the table
    By ayampanggang in forum AWT / Swing
    Replies: 3
    Last Post: 11-27-2008, 08:20 PM

Posting Permissions

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