Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9201749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:05:32+00:00 2026-06-17T23:05:32+00:00

I have a GUI application that connects to a SQL Server 2008 database using

  • 0

I have a GUI application that connects to a SQL Server 2008 database using sqljdbc4.jar. If I run this from the command line it works great.

However, once I wrap it into an executable JAR, I get a “No suitable driver found for jdbc:sqlserver://myServer:1433;databaseName=myDb” error. I know that my Windows system CLASSPATH is ignored once it’s in a JAR, but I can’t figure out include the sqljdbc4.jar within the executable JAR and get a portable application.

My most recent attempt to fix this is as follows:

My MANIFEST.MF file:

Manifest-Version: 1.0
Class-Path: lib/sqljdbc4.jar
Created-By: 1.7.0_11 (Oracle Corporation)
Main-Class: MyApp

The command I use to compile the JAR:

jar cmf MANIFEST.MF MyApp.jar MyApp.class help.html lib

My directory structure is below. I am running the jar command inside the MyApp directory.

+ MyApp
    + lib
        - sqljdbc.jar
    - help.html
    - MANIFEST.MF
    - MyApp.class
    - MyApp.java

When I create the JAR and run it inside the MyApp directory, it works fine. As soon as I pull it out of the directory, I get the error. How can I make the JAR access the sqljdbc.jar that is available internally?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:05:34+00:00Added an answer on June 17, 2026 at 11:05 pm

    When you have an executable jar MyApp.jar with entry in the manifest.mf:

    Class-Path: lib/sqljdbc4.jar
    

    This means that the jar has an external dependency to sqljdbc4.jar in the (relative) folder lib. It is not included in the jar you created! So you need to make sure that there is a lib-folder containing sqljdbc4.jar relative to that jar when you execute it. So the folder structure when executing needs to be;

    + (a folder)
       + lib
          - sqljdbc.jar
       - MyApp.jar
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GUI C++ application (Visual Studio 2008) that needs to be converted
I have a Java application that run as a background service, i.e. no GUI.
I have a Qt application that was developed using Qt Creator and the GUI
I have a GUI C# application that has a single button Start/Stop. Originally this
I have a Python application (with GUI, using PyQt4) that gets spawned by the
I have an application (Gtk) that has an embedded server (using circuits). Both components
I have a GUI application that needs to run long calculations (think a minute
I have a Java application that connects to a MySQL database and uses a
I have a Adobe Flash Builder GUI application that connects to Red5 to communicate.
I have a Windows GUI application that's using the Qt framework (currently version 3.3.5,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.