Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2011
    Location
    abuja
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts

    packaging sqlite db with java application

    Hi guys, I have a java GUI application that I want it to insert and query a sqlite database (sqlite3). Now my application works fine, it connects to the database via (sqlite-jdbc-3.6.20.jar as connector), inserts, retrieves.
    So far, I have 10 java objects (10 classes) with another java class that has the main method making all 11 java classes. I have 6 .png image files because of the nature of the application. Below is an analysis of what I have done so far:
    -11 java classes
    -6 .png file
    all in the same folder.
    while i have my database file in a folder in my local disk(c which i access via my connection object.
    Every thing works fine on my system.
    Now I want to deploy the application and distribute it, I have to convert my java class(with a main method) to jar file, after that it still works well on my system.
    When I copy my application jar file, sqlite-jdbc-3.6.20.jar, and the sqlite db file to a folder and transfer it another system, the java appliction jar runs but throws a classpath not found exception(as in doesn't queries the database neither does it inserts to the database).
    I need you guys help on how i will package together this sqlite db with my application for distribution.
    NB: I did everything on JCreator.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    You'll need to add any classpaths required (specifically for things like the sqlite jdbc connector) as a part of the manifest. JCreator I'd assume has a way of doing this via the gui when creating the jar.
    Check here: http://docs.oracle.com/javase/tutorial/deployment/jar/
    And: http://docs.oracle.com/javase/tutori...r/downman.html
    Also, you'll probably need to sign it if you are working with filesystem, for that you can follow this tutorial: http://docs.oracle.com/javase/tutori...signindex.html

    You'd need to verify the error to be sure, but if its throwing a classpath error my expectation is it cannot load the driver you are using from the sqlite-jdbc connector (which you will also need to provide). The stack trace should tell you which class its attempting to load.

  • #3
    New Coder
    Join Date
    Dec 2011
    Location
    abuja
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts
    thanks, am gonna read those tutorial links you provided and anything arises, I will let you know.


  •  

    Posting Permissions

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