title: Open a Sqlite connection with an exclusive lock in Java / Scala using SQlite JDBC library
body: <p>I wish to have read only and write connections for sqlite, when I open a write connection, I wish it to have an exclusive lock.
  This looks like it should work</p>
  
  <pre><code>val config = new SQLiteConfig();
  config.setLockingMode(org.sqlite.SQLiteConfig.LockingMode.EXCLUSIVE)
  
  val connection = DriverManager.getConnection("jdbc:sqlite:" + this.getPath() +"\\" + this.dbName, config.toProperties)
  </code></pre>
  
  <p>but unfortunately I get an exception</p>
  
  <pre><code>Exception in thread "main" java.sql.BatchUpdateException: batch entry 0: query returns results
  </code></pre>
  
  <p>I have also tried setting the properties directly, rather than using the  Sqlite jdbc SQLiteConfig class</p>
  
  <pre><code>val prop = new Properties();
  prop.setProperty("locking_mode", "EXCLUSIVE");
  </code></pre>
  
  <p>Any suggestions?</p>