title: Failed sqljdbc4 connection when in executable JAR
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>My most recent attempt to fix this is as follows:</p>
  
  <p>My MANIFEST.MF file:</p>
  
  <pre><code>Manifest-Version: 1.0
  Class-Path: lib/sqljdbc4.jar
  Created-By: 1.7.0_11 (Oracle Corporation)
  Main-Class: MyApp
  </code></pre>
  
  <p>The command I use to compile the JAR:</p>
  
  <pre><code>jar cmf MANIFEST.MF MyApp.jar MyApp.class help.html lib
  </code></pre>
  
  <p>My directory structure is below.  I am running the <code>jar</code> command inside the MyApp directory.</p>
  
  <pre><code>+ MyApp
      + lib
          - sqljdbc.jar
      - help.html
      - MANIFEST.MF
      - MyApp.class
      - MyApp.java
  </code></pre>
  
  <p>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?</p>
  
  <p>Thanks in advance.</p>