package org.sqlite;

import java.sql.*;
import java.util.*;

public class JDBC implements Driver
{
    static {
        try {
            DriverManager.registerDriver(new JDBC());
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public int getMajorVersion() { return 1; }
    public int getMinorVersion() { return 1; }
    public boolean jdbcCompliant() { return false; }
    public boolean acceptsURL(String url) {
        return url.startsWith("jdbc:sqlite:");
    }
    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
        throws SQLException {
        return new DriverPropertyInfo[] {};
    }

    public Connection connect(String url, Properties info) throws SQLException {
        if (!acceptsURL(url)) return null;
        return new Conn(url.substring(12));
    }
}


@@ -92,16 +92,73 @@
 river%0A%7B%0A
+    public static final String PREFIX = %22jdbc:sqlite:%22;%0A%0A
     stat
@@ -162,16 +162,16 @@
 tatic %7B%0A
-
         
@@ -401,32 +401,33 @@
 ) %7B return 1; %7D%0A
+%0A
     public boole
@@ -459,24 +459,25 @@
 rn false; %7D%0A
+%0A
     public b
@@ -530,34 +530,41 @@
  url
-.startsWith(%22jdbc:sqlite:%22
+ != null && url.startsWith(PREFIX
 );%0A 
@@ -564,24 +564,25 @@
 FIX);%0A    %7D%0A
+%0A
     public D
@@ -646,16 +646,20 @@
 s info)%0A
+    
         
@@ -672,32 +672,32 @@
  SQLException %7B%0A
-
         return n
@@ -867,40 +867,184 @@
     
-return new Conn(url.substring(12
+url = url.trim();%0A%0A        // if no file name is given use a memory database%0A        return new Conn(PREFIX.equals(url) ?%0A            %22:memory:%22 : url.substring(PREFIX.length()
 ));%0A
@@ -1049,11 +1049,10 @@
 ;%0A    %7D%0A
+
 %7D%0A
-%0A

use memory db if no filename given