permaculture playing cards*
The moose likes Swing / AWT / SWT and the fly likes MY swing database application can not connect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "MY swing database application can not connect" Watch "MY swing database application can not connect" New topic
Author

MY swing database application can not connect

muntago Richard
Ranch Hand

Joined: Nov 13, 2010
Posts: 82
Good day able one, this my applications runs perfectly and insert data to database when i runs it as APPleme.java, but when i make executale and save it as Example.jar, when i runs it, open but on trying to insert values, it refuses to connect to database . can you tell me what is the problem
below is the code

so how do i make my executable files to connect my database via mysql connector
thanks
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Without seeing the actual error (please post), I'm only guessing. I infer from your post that you got your application running in Eclipse. Check that you have all the necessary dependent jar files in your jar file or that your classpath points to those dependent jar files.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

Without seeing a stack trace it's pretty hard to guess, but quite likely your executable jar's manifest doesn't specify the relative path to the JDBC driver's jar. Either that, or you didn't put the JDBC driver's jar in the directory where the manifest says it should go.
muntago Richard
Ranch Hand

Joined: Nov 13, 2010
Posts: 82
THey wasn't any error. the code is perfect when i saved it as Appleme.java and runs it from apache. but when i make it executable as regards to Examples.jar, its no longer seeing or connecting to mysql database. here is my manifest and how do i link mysql connector.jar to the manifest

muntago Richard
Ranch Hand

Joined: Nov 13, 2010
Posts: 82
besides, mysql connector is in the same directory as the Example.jar applications.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

muntago Richard wrote:THey wasn't any error.

Excellent! Then you don't have a problem and the case is closed, right?
here is my manifest and how do i link mysql connector.jar to the manifest


Ah. Apparently you do have a problem, then. So there is an error which causes this problem, you just haven't found any concrete evidence of it yet.

Anyway here's a link to the JAR tutorial. It would be much easier for you to read that rather than having somebody provide individual instruction to you.
muntago Richard
Ranch Hand

Joined: Nov 13, 2010
Posts: 82
YEAH I have gone through the tutorial links you provided and its working. You are the greatest. thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MY swing database application can not connect