wood burning stoves*
The moose likes JDBC and the fly likes jdbc not connecting when jar double-clicked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "jdbc not connecting when jar double-clicked" Watch "jdbc not connecting when jar double-clicked" New topic
Author

jdbc not connecting when jar double-clicked

Chris Dancy
Ranch Hand

Joined: Feb 14, 2006
Posts: 136
So im not sure whats going on here. Im writing a project which in turn is an executable jar. It connects to a mysql server running wherever. So when i package the project everything goes according to plan...or so you think it does. When running the project from command line java -jar myproject.jar everything works great and the database gets loaded as well. Yet when i navigate to that folder graphically and double click the executable jar it wont load the JDBC. Im not sure why this is, that it will do it through the command line but not through double-clicking. here is the manifest file i created if this helps any:

Manifest-Version: 1.0
Main-Class: profileCreator/Main
Class-Path: mysql/mysqlConnector.jar

any help in this matter is greatly appreciated.
Sincerely,
Chris Dancy


("Anger is not an emotion, its a symptom of fear.")
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30361
    
150

Originally posted by Chris Dancy:
double click the executable jar it wont load the JDBC.

Can you elaborate on this? What happens? Class not found, etc?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Class-Path: mysql/mysqlConnector.jar
This means that if your executable jar file is in directory X, then the mysqlConnector.jar file must be in directory X/mysql. If that's not the case, then you will be having problems with not being able to find the driver class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jdbc not connecting when jar double-clicked