title: How can I specify a RELATIVE JDBC SQLite url (path?)
body: <p>I've been trying to get this work for two days and tried all suggestions that I could find. Alas, without success, so far.</p>
  
  <p>This is what I'm trying to do: I am building a small (java swing) desktop database application. I'm using Netbeans 7.0 and SQLite, and found the JDBC driver from <a href="http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC" rel="nofollow noreferrer">http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC</a> to work fine as long as I specify an absolute path in the JDBC URL:</p>
  
  <pre><code>jdbc:sqlite://Users.../lib/db/ithildin.db
  </code></pre>
  
  <p>Here's how it looks in Netbeans' Services -> Databases tab, using an absolute URL:</p>
  
  <p><img src="https://i.stack.imgur.com/SOtzM.jpg" alt="so far, so good"></p>
  
  <p>opening the connection and then the tables node shows the available tables. </p>
  
  <p>But because I intend to distribute this application to other people, using an absolute path is not going to work. From what I have read here and there it seems to be possible to also specify a relative path to the SQLite database file, but I cannot get it to work whatever I try.</p>
  
  <p>The strange thing is that when I create a connection in Netbeans it initially seems to work when I put both the sqlite jdbc driver jar and the sqlite database file in a /db subdirectory in /lib (in the Netbeans project directory):</p>
  
  <p><img src="https://i.stack.imgur.com/ICBF6.jpg" alt="Netbeans new connection wizard"> </p>
  
  <p>and when I open the new connection it maintains that illusion - </p>
  
  <p><img src="https://i.stack.imgur.com/DYXXi.jpg" alt="looking good"> </p>
  
  <p>but when I open the "Tables" node it turns out to be empty:</p>
  
  <p><img src="https://i.stack.imgur.com/TN6Dg.jpg" alt="uh oh"></p>
  
  <p>Similary, this connection seems valid but as soon as I try to use it - for instance in "Generating Entity Classes From Database" it tells me that there <em>aren't any tables in that database.</em> </p>
  
  <p>Does anyone know a way out of this? I'd much appreciate it. </p>
  
  <p>Lúthien</p>