Browse Source

remove unwanted files.

root 4 years ago
parent
commit
0787e1c4ca
100 changed files with 0 additions and 8248 deletions
  1. 0 24
      jdbcsqlitenative/META-INF/MANIFEST.MF
  2. 0 202
      jdbcsqlitenative/META-INF/maven/org.xerial/sqlite-jdbc/LICENSE
  3. 0 24
      jdbcsqlitenative/META-INF/maven/org.xerial/sqlite-jdbc/LICENSE.zentus
  4. 0 2
      jdbcsqlitenative/META-INF/maven/org.xerial/sqlite-jdbc/VERSION
  5. 0 5
      jdbcsqlitenative/META-INF/maven/org.xerial/sqlite-jdbc/pom.properties
  6. 0 215
      jdbcsqlitenative/META-INF/maven/org.xerial/sqlite-jdbc/pom.xml
  7. 0 1
      jdbcsqlitenative/META-INF/services/java.sql.Driver
  8. 0 0
      jdbcsqlitenative/NativeDB.java
  9. BIN
      jdbcsqlitenative/Sample.class
  10. 0 54
      jdbcsqlitenative/Sample.java
  11. BIN
      jdbcsqlitenative/org/sqlite/ExtendedCommand$BackupCommand.class
  12. BIN
      jdbcsqlitenative/org/sqlite/ExtendedCommand$RestoreCommand.class
  13. BIN
      jdbcsqlitenative/org/sqlite/ExtendedCommand$SQLExtension.class
  14. BIN
      jdbcsqlitenative/org/sqlite/ExtendedCommand.class
  15. 0 156
      jdbcsqlitenative/org/sqlite/ExtendedCommand.java
  16. BIN
      jdbcsqlitenative/org/sqlite/Function$Aggregate.class
  17. BIN
      jdbcsqlitenative/org/sqlite/Function.class
  18. 0 277
      jdbcsqlitenative/org/sqlite/Function.java
  19. BIN
      jdbcsqlitenative/org/sqlite/JDBC.class
  20. 0 116
      jdbcsqlitenative/org/sqlite/JDBC.java
  21. BIN
      jdbcsqlitenative/org/sqlite/SQLite.class
  22. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig$DateClass.class
  23. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig$DatePrecision.class
  24. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig$Encoding.class
  25. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig$JournalMode.class
  26. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig$LockingMode.class
  27. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig$Pragma.class
  28. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig$PragmaValue.class
  29. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig$SynchronousMode.class
  30. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig$TempStore.class
  31. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig$TransactionMode.class
  32. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConfig.class
  33. 0 801
      jdbcsqlitenative/org/sqlite/SQLiteConfig.java
  34. BIN
      jdbcsqlitenative/org/sqlite/SQLiteConnection.class
  35. 0 64
      jdbcsqlitenative/org/sqlite/SQLiteConnection.java
  36. BIN
      jdbcsqlitenative/org/sqlite/SQLiteDataSource.class
  37. 0 466
      jdbcsqlitenative/org/sqlite/SQLiteDataSource.java
  38. BIN
      jdbcsqlitenative/org/sqlite/SQLiteErrorCode.class
  39. 0 104
      jdbcsqlitenative/org/sqlite/SQLiteErrorCode.java
  40. BIN
      jdbcsqlitenative/org/sqlite/SQLiteJDBCLoader.class
  41. 0 350
      jdbcsqlitenative/org/sqlite/SQLiteJDBCLoader.java
  42. BIN
      jdbcsqlitenative/org/sqlite/SQLiteOpenMode.class
  43. 0 61
      jdbcsqlitenative/org/sqlite/SQLiteOpenMode.java
  44. BIN
      jdbcsqlitenative/org/sqlite/core/Codes.class
  45. 0 106
      jdbcsqlitenative/org/sqlite/core/Codes.java
  46. BIN
      jdbcsqlitenative/org/sqlite/core/CoreConnection.class
  47. 0 397
      jdbcsqlitenative/org/sqlite/core/CoreConnection.java
  48. BIN
      jdbcsqlitenative/org/sqlite/core/CoreDatabaseMetaData$PrimaryKeyFinder.class
  49. BIN
      jdbcsqlitenative/org/sqlite/core/CoreDatabaseMetaData.class
  50. 0 302
      jdbcsqlitenative/org/sqlite/core/CoreDatabaseMetaData.java
  51. BIN
      jdbcsqlitenative/org/sqlite/core/CorePreparedStatement$1.class
  52. BIN
      jdbcsqlitenative/org/sqlite/core/CorePreparedStatement.class
  53. 0 132
      jdbcsqlitenative/org/sqlite/core/CorePreparedStatement.java
  54. BIN
      jdbcsqlitenative/org/sqlite/core/CoreResultSet.class
  55. 0 150
      jdbcsqlitenative/org/sqlite/core/CoreResultSet.java
  56. BIN
      jdbcsqlitenative/org/sqlite/core/CoreStatement.class
  57. 0 124
      jdbcsqlitenative/org/sqlite/core/CoreStatement.java
  58. BIN
      jdbcsqlitenative/org/sqlite/core/DB$ProgressObserver.class
  59. BIN
      jdbcsqlitenative/org/sqlite/core/DB.class
  60. 0 964
      jdbcsqlitenative/org/sqlite/core/DB.java
  61. 0 972
      jdbcsqlitenative/org/sqlite/core/NativeDB.c
  62. BIN
      jdbcsqlitenative/org/sqlite/core/NativeDB.class
  63. BIN
      jdbcsqlitenative/org/sqlite/date/DateFormatUtils.class
  64. 0 323
      jdbcsqlitenative/org/sqlite/date/DateFormatUtils.java
  65. BIN
      jdbcsqlitenative/org/sqlite/date/DateParser.class
  66. 0 105
      jdbcsqlitenative/org/sqlite/date/DateParser.java
  67. BIN
      jdbcsqlitenative/org/sqlite/date/DatePrinter.class
  68. 0 125
      jdbcsqlitenative/org/sqlite/date/DatePrinter.java
  69. BIN
      jdbcsqlitenative/org/sqlite/date/ExceptionUtils.class
  70. 0 99
      jdbcsqlitenative/org/sqlite/date/ExceptionUtils.java
  71. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateFormat$1.class
  72. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateFormat.class
  73. 0 603
      jdbcsqlitenative/org/sqlite/date/FastDateFormat.java
  74. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser$1.class
  75. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser$2.class
  76. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser$3.class
  77. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser$4.class
  78. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser$CaseInsensitiveTextStrategy.class
  79. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser$CopyQuotedStrategy.class
  80. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser$ISO8601TimeZoneStrategy.class
  81. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser$NumberStrategy.class
  82. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser$Strategy.class
  83. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser$TimeZoneStrategy.class
  84. BIN
      jdbcsqlitenative/org/sqlite/date/FastDateParser.class
  85. 0 924
      jdbcsqlitenative/org/sqlite/date/FastDateParser.java
  86. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$CharacterLiteral.class
  87. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$Iso8601_Rule.class
  88. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$NumberRule.class
  89. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$PaddedNumberField.class
  90. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$Rule.class
  91. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$StringLiteral.class
  92. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$TextField.class
  93. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$TimeZoneDisplayKey.class
  94. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$TimeZoneNameRule.class
  95. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$TimeZoneNumberRule.class
  96. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$TwelveHourField.class
  97. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$TwentyFourHourField.class
  98. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$TwoDigitMonthField.class
  99. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$TwoDigitNumberField.class
  100. BIN
      jdbcsqlitenative/org/sqlite/date/FastDatePrinter$TwoDigitYearField.class

+ 0 - 24
jdbcsqlitenative/META-INF/MANIFEST.MF

@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Archiver-Version: Plexus Archiver
-Created-By: Apache Maven Bundle Plugin
-Built-By: leo
-Build-Jdk: 1.8.0_40
-Bnd-LastModified: 1443895600730
-Bundle-Description: SQLite JDBC library
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-ManifestVersion: 2
-Bundle-Name: SQLite JDBC
-Bundle-SymbolicName: org.xerial.sqlite-jdbc;singleton:=true
-Bundle-Version: 3.8.11.2
-Export-Package: org.sqlite.core;uses:="org.sqlite,org.sqlite.date,org.
- sqlite.jdbc4";version="3.8.11.2",org.sqlite.date;version="3.8.11.2",o
- rg.sqlite;uses:="javax.sql,org.ibex.nestedvm,org.sqlite.core,org.sqli
- te.jdbc4";version="3.8.11.2",org.sqlite.javax;uses:="javax.sql,org.sq
- lite,org.sqlite.jdbc4";version="3.8.11.2",org.sqlite.jdbc3;uses:="org
- .sqlite,org.sqlite.core";version="3.8.11.2",org.sqlite.jdbc4;uses:="j
- avax.sql,org.sqlite,org.sqlite.core,org.sqlite.jdbc3";version="3.8.11
- .2",org.sqlite.util;version="3.8.11.2"
-Import-Package: javax.sql;resolution:=optional,org.ibex.nestedvm;resol
- ution:=optional
-Tool: Bnd-2.1.0.20130426-122213
-

+ 0 - 202
jdbcsqlitenative/META-INF/maven/org.xerial/sqlite-jdbc/LICENSE

@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

+ 0 - 24
jdbcsqlitenative/META-INF/maven/org.xerial/sqlite-jdbc/LICENSE.zentus

@@ -1,24 +0,0 @@
-Copyright (c) 2006, David Crawshaw.  All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-

+ 0 - 2
jdbcsqlitenative/META-INF/maven/org.xerial/sqlite-jdbc/VERSION

@@ -1,2 +0,0 @@
-version=3.8.11
-

+ 0 - 5
jdbcsqlitenative/META-INF/maven/org.xerial/sqlite-jdbc/pom.properties

@@ -1,5 +0,0 @@
-#Generated by Maven
-#Sat Oct 03 11:01:48 PDT 2015
-version=3.8.11.2
-groupId=org.xerial
-artifactId=sqlite-jdbc

+ 0 - 215
jdbcsqlitenative/META-INF/maven/org.xerial/sqlite-jdbc/pom.xml

@@ -1,215 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.xerial</groupId>
-  <artifactId>sqlite-jdbc</artifactId>
-  <version>3.8.11.2</version>
-  <name>SQLite JDBC</name>
-  <description>SQLite JDBC library</description>
-
-  <parent>
-    <groupId>org.sonatype.oss</groupId>
-    <artifactId>oss-parent</artifactId>
-    <version>9</version>
-  </parent>
-
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-  </properties>
-
-  <licenses>
-    <license>
-      <name>The Apache Software License, Version 2.0</name>
-      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-      <distribution>repo</distribution>
-    </license>
-  </licenses>
-
-  <developers>
-    <developer>
-      <id>leo</id>
-      <name>Taro L. Saito</name>
-      <email>leo@xerial.org</email>
-      <organization>Xerial Project</organization>
-      <roles>
-        <role>Architect</role>
-        <role>Project Manager</role>
-        <role>Chief Developer</role>
-      </roles>
-      <timezone>+9</timezone>
-    </developer>
-  </developers>
-
-  <build>
-    <resources>
-      <resource>
-        <directory>src/main/java</directory>
-      </resource>
-      <resource>
-        <directory>src/main/resources</directory>
-        <includes>
-          <include>org/**</include>
-        </includes>
-      </resource>
-      <resource>
-        <directory>src/main/resources</directory>
-        <targetPath>META-INF/services</targetPath>
-        <includes>
-          <include>java.sql.Driver</include>
-        </includes>
-      </resource>
-      <resource>
-        <directory>${basedir}</directory>
-        <targetPath>META-INF/maven/${project.groupId}/${project.artifactId}</targetPath>
-        <includes>
-          <include>VERSION</include>
-          <include>LICENSE*</include>
-        </includes>
-      </resource>
-    </resources>
-
-    <testResources>
-      <testResource>
-        <directory>src/test/java</directory>
-        <excludes>
-          <exclude>**/*.java</exclude>
-        </excludes>
-      </testResource>
-      <testResource>
-        <directory>src/test/resources</directory>
-      </testResource>
-    </testResources>
-
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.1</version>
-        <configuration>
-          <source>1.5</source>
-          <target>1.6</target>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-report-plugin</artifactId>
-        <version>2.6</version>
-      </plugin>
-
-      <plugin>
-        <artifactId>maven-release-plugin</artifactId>
-        <version>2.1</version>
-        <configuration>
-          <!--  do not run site-deploy goal, included in the default settings  -->
-          <goals>deploy</goals>
-          <pushChanges>false</pushChanges>
-          <localCheckout>true</localCheckout>
-          <connectionUrl>scm:hg:ssh://hg@bitbucket.org/xerial/sqlite-jdbc</connectionUrl>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-javadoc-plugin</artifactId>
-        <version>2.10.3</version>
-        <configuration>
-          <additionalparam>-Xdoclint:none</additionalparam>
-        </configuration>
-      </plugin>
-      
-      <plugin>
-        <artifactId>maven-jar-plugin</artifactId>
-        <version>2.3.2</version>
-        <configuration>
-          <!-- Pick the MANIFEST generated by the bundle plugin -->
-          <archive>
-            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-          </archive>
-        </configuration>
-      </plugin>
-
-      
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>org.xerial.sqlite-jdbc;singleton:=true</Bundle-SymbolicName>
-            <Import-Package>
-              *;resolution:=optional
-            </Import-Package>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-
-    
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>maven-bundle-plugin</artifactId>
-          <version>2.4.0</version>
-          <extensions>true</extensions>
-          <executions>
-            <execution>
-              <!-- Need to have MANIFEST.MF in place before 
-                    packaging, so unit-tests will work -->
-              <phase>process-classes</phase>
-              <goals>
-                <goal>manifest</goal>
-              </goals>
-            </execution>
-          </executions>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
-
-  <scm>
-    <connection>scm:git:git://github.com/xerial/sqlite-jdbc.git</connection>
-    <developerConnection>scm:git:git@github.com:xerial/sqlite-jdbc.git</developerConnection>
-    <url>https://github.com/xerial/sqlite-jdbc</url>
-  </scm>
-
-  <profiles>
-    <profile>
-      <id>release-sign-artifacts</id>
-      <activation>
-        <property>
-          <name>performRelease</name>
-          <value>true</value>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-gpg-plugin</artifactId>
-            <version>1.4</version>
-            <executions>
-              <execution>
-                <id>sign-artifacts</id>
-                <phase>verify</phase>
-                <goals>
-                  <goal>sign</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.8.2</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-</project>

+ 0 - 1
jdbcsqlitenative/META-INF/services/java.sql.Driver

@@ -1 +0,0 @@
-org.sqlite.JDBC

+ 0 - 0
jdbcsqlitenative/org/sqlite/core/NativeDB.java → jdbcsqlitenative/NativeDB.java


BIN
jdbcsqlitenative/Sample.class


+ 0 - 54
jdbcsqlitenative/Sample.java

@@ -1,54 +0,0 @@
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-public class Sample
-{
-  public static void main(String[] args) throws ClassNotFoundException
-  {
-    // load the sqlite-JDBC driver using the current class loader
-    Class.forName("org.sqlite.JDBC");
-    
-    Connection connection = null;
-    try
-    {
-      // create a database connection
-      connection = DriverManager.getConnection("jdbc:sqlite:sample.db");
-      Statement statement = connection.createStatement();
-      statement.setQueryTimeout(30);  // set timeout to 30 sec.
-      
-      statement.executeUpdate("drop table if exists person");
-      statement.executeUpdate("create table person (id integer, name string)");
-      statement.executeUpdate("insert into person values(1, 'leo')");
-      statement.executeUpdate("insert into person values(2, 'yui')");
-      ResultSet rs = statement.executeQuery("select * from person");
-      while(rs.next())
-      {
-        // read the result set
-        System.out.println("name = " + rs.getString("name"));
-        System.out.println("id = " + rs.getInt("id"));
-      }
-    }
-    catch(SQLException e)
-    {
-      // if the error message is "out of memory", 
-      // it probably means no database file is found
-      System.err.println(e.getMessage());
-    }
-    finally
-    {
-      try
-      {
-        if(connection != null)
-          connection.close();
-      }
-      catch(SQLException e)
-      {
-        // connection close failed.
-        System.err.println(e);
-      }
-    }
-  }
-}

BIN
jdbcsqlitenative/org/sqlite/ExtendedCommand$BackupCommand.class


BIN
jdbcsqlitenative/org/sqlite/ExtendedCommand$RestoreCommand.class


BIN
jdbcsqlitenative/org/sqlite/ExtendedCommand$SQLExtension.class


BIN
jdbcsqlitenative/org/sqlite/ExtendedCommand.class


+ 0 - 156
jdbcsqlitenative/org/sqlite/ExtendedCommand.java

@@ -1,156 +0,0 @@
-//--------------------------------------
-// sqlite-jdbc Project
-//
-// ExtendedCommand.java
-// Since: Mar 12, 2010
-//
-// $URL$ 
-// $Author$
-//--------------------------------------
-package org.sqlite;
-
-import java.sql.SQLException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.sqlite.core.DB;
-
-/**
- * parsing SQLite specific extension of SQL command
- * 
- * @author leo
- * 
- */
-public class ExtendedCommand
-{
-    public static interface SQLExtension
-    {
-        public void execute(DB db) throws SQLException;
-    }
-
-    /**
-     * Parses extended commands of "backup" or "restore" for SQLite database.  
-     * @param sql One of the extended commands:<br/>
-     *      backup sourceDatabaseName to destinationFileName OR restore targetDatabaseName from sourceFileName
-     * @return BackupCommand object if the argument is a backup command; RestoreCommand object if
-     *         the argument is a restore command;
-     * @throws SQLException
-     */
-    public static SQLExtension parse(String sql) throws SQLException {
-        if (sql == null)
-            return null;
-
-        if (sql.startsWith("backup"))
-            return BackupCommand.parse(sql);
-        else if (sql.startsWith("restore"))
-            return RestoreCommand.parse(sql);
-
-        return null;
-    }
-
-    /**
-     * Remove the quotation mark from string.
-     * @param s String with quotation mark.
-     * @return String with quotation mark removed.
-     */
-    public static String removeQuotation(String s) {
-        if (s == null)
-            return s;
-
-        if ((s.startsWith("\"") && s.endsWith("\"")) || (s.startsWith("'") && s.endsWith("'")))
-            return s.substring(1, s.length() - 1);
-        else
-            return s;
-    }
-
-    public static class BackupCommand implements SQLExtension
-    {
-        public final String srcDB;
-        public final String destFile;
-
-        /**
-         * Constructs a BackupCommand instance that backup the database to a target file. 
-         * @param srcDB Source database name.
-         * @param destFile Target file name.
-         */
-        public BackupCommand(String srcDB, String destFile) {
-            this.srcDB = srcDB;
-            this.destFile = destFile;
-        }
-
-        private static Pattern backupCmd = Pattern
-                                                 .compile("backup(\\s+(\"[^\"]*\"|'[^\']*\'|\\S+))?\\s+to\\s+(\"[^\"]*\"|'[^\']*\'|\\S+)");
-
-        /**
-         * Parses SQLite database backup command and creates a BackupCommand object.
-         * @param sql SQLite database backup command.
-         * @return BackupCommand object.
-         * @throws SQLException
-         */
-        public static BackupCommand parse(String sql) throws SQLException {
-            if (sql != null) {
-                Matcher m = backupCmd.matcher(sql);
-                if (m.matches()) {
-                    String dbName = removeQuotation(m.group(2));
-                    String dest = removeQuotation(m.group(3));
-                    if (dbName == null || dbName.length() == 0)
-                        dbName = "main";
-
-                    return new BackupCommand(dbName, dest);
-                }
-            }
-            throw new SQLException("syntax error: " + sql);
-        }
-
-        public void execute(DB db) throws SQLException {
-            db.backup(srcDB, destFile, null);
-        }
-
-    }
-
-    public static class RestoreCommand implements SQLExtension
-    {
-        public final String    targetDB;
-        public final String    srcFile;
-        private static Pattern restoreCmd = Pattern
-                                                  .compile("restore(\\s+(\"[^\"]*\"|'[^\']*\'|\\S+))?\\s+from\\s+(\"[^\"]*\"|'[^\']*\'|\\S+)");
-
-        /**
-         * Constructs a RestoreCommand instance that restores the database from a given source file. 
-         * @param targetDB Target database name
-         * @param srcFile Source file name
-         */
-        public RestoreCommand(String targetDB, String srcFile) {
-            this.targetDB = targetDB;
-            this.srcFile = srcFile;
-        }
-
-        /**
-         * Parses SQLite database restore command and creates a RestoreCommand object.
-         * @param sql SQLite restore backup command
-         * @return RestoreCommand object.
-         * @throws SQLException
-         */
-        public static RestoreCommand parse(String sql) throws SQLException {
-            if (sql != null) {
-                Matcher m = restoreCmd.matcher(sql);
-                if (m.matches()) {
-                    String dbName = removeQuotation(m.group(2));
-                    String dest = removeQuotation(m.group(3));
-                    if (dbName == null || dbName.length() == 0)
-                        dbName = "main";
-                    return new RestoreCommand(dbName, dest);
-                }
-            }
-            throw new SQLException("syntax error: " + sql);
-        }
-
-        /**
-         * @see org.sqlite.ExtendedCommand.SQLExtension#execute(org.sqlite.core.DB)
-         */
-        public void execute(DB db) throws SQLException {
-            db.restore(targetDB, srcFile, null);
-        }
-    }
-
-}

BIN
jdbcsqlitenative/org/sqlite/Function$Aggregate.class


BIN
jdbcsqlitenative/org/sqlite/Function.class


+ 0 - 277
jdbcsqlitenative/org/sqlite/Function.java

@@ -1,277 +0,0 @@
-/*
- * Copyright (c) 2007 David Crawshaw <david@zentus.com>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-package org.sqlite;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.sqlite.core.Codes;
-import org.sqlite.core.DB;
-
-/** Provides an interface for creating SQLite user-defined functions.
- *
- * <p>A subclass of <tt>org.sqlite.Function</tt> can be registered with
- * <tt>Function.create()</tt> and called by the name it was given. All
- * functions must implement <tt>xFunc()</tt>, which is called when SQLite
- * runs the custom function.</p>
- *
- * Eg.
- *
- * <pre>
- *      Class.forName("org.sqlite.JDBC");
- *      Connection conn = DriverManager.getConnection("jdbc:sqlite:");
- *
- *      Function.create(conn, "myFunc", new Function() {
- *          protected void xFunc() {
- *              System.out.println("myFunc called!");
- *          }
- *      });
- *
- *      conn.createStatement().execute("select myFunc();");
- *  </pre>
- *
- *  <p>Arguments passed to a custom function can be accessed using the
- *  <tt>protected</tt> functions provided. <tt>args()</tt> returns
- *  the number of arguments passed, while
- *  <tt>value_&lt;type&gt;(int)</tt> returns the value of the specific
- *  argument. Similarly a function can return a value using the
- *  <tt>result(&lt;type&gt;)</tt> function.</p>
- *
- *  <p>Aggregate functions are not yet supported, but coming soon.</p>
- *
- */
-public abstract class Function
-{
-    private SQLiteConnection conn;
-    private DB db;
-
-    long context = 0;     // pointer sqlite3_context*
-    long value = 0;       // pointer sqlite3_value**
-    int args = 0;
-
-    /**
-     * Registers a given function with the connection.
-     * @param conn The connection.
-     * @param name The name of the function.
-     * @param f The function to register.
-     */
-    public static final void create(Connection conn, String name, Function f)
-            throws SQLException {
-        if (conn == null || !(conn instanceof SQLiteConnection)) {
-            throw new SQLException("connection must be to an SQLite db");
-        }
-        if (conn.isClosed()) {
-            throw new SQLException("connection closed");
-        }
-
-        f.conn = (SQLiteConnection)conn;
-        f.db = f.conn.db();
-
-        if (name == null || name.length() > 255) {
-            throw new SQLException("invalid function name: '"+name+"'");
-        }
-
-        if (f.db.create_function(name, f) != Codes.SQLITE_OK) {
-            throw new SQLException("error creating function");
-        }
-    }
-
-    /**
-     * Removes a named function from the given connection.
-     * @param conn The connection to remove the function from.
-     * @param name The name of the function.
-     * @throws SQLException
-     */
-    public static final void destroy(Connection conn, String name)
-            throws SQLException {
-        if (conn == null || !(conn instanceof SQLiteConnection)) {
-            throw new SQLException("connection must be to an SQLite db");
-        }
-        ((SQLiteConnection)conn).db().destroy_function(name);
-    }
-
-
-    /**
-     * Called by SQLite as a custom function. Should access arguments
-     * through <tt>value_*(int)</tt>, return results with
-     * <tt>result(*)</tt> and throw errors with <tt>error(String)</tt>.
-     */
-    protected abstract void xFunc() throws SQLException;
-
-
-    /**
-     * Returns the number of arguments passed to the function.
-     * Can only be called from <tt>xFunc()</tt>.
-     */
-    protected synchronized final int args()
-        throws SQLException { checkContext(); return args; }
-
-    /**
-     * Called by <tt>xFunc</tt> to return a value.
-     * @param value
-     */
-    protected synchronized final void result(byte[] value)
-        throws SQLException { checkContext(); db.result_blob(context, value); }
-
-    /**
-     * Called by <tt>xFunc</tt> to return a value.
-     * @param value
-     */
-    protected synchronized final void result(double value)
-        throws SQLException { checkContext(); db.result_double(context,value);}
-
-    /**
-     * Called by <tt>xFunc</tt> to return a value.
-     * @param value
-     */
-    protected synchronized final void result(int value)
-        throws SQLException { checkContext(); db.result_int(context, value); }
-
-    /**
-     * Called by <tt>xFunc</tt> to return a value.
-     * @param value
-     */
-    protected synchronized final void result(long value)
-        throws SQLException { checkContext(); db.result_long(context, value); }
-
-    /**
-     * Called by <tt>xFunc</tt> to return a value.
-     */
-    protected synchronized final void result()
-        throws SQLException { checkContext(); db.result_null(context); }
-
-    /**
-     * Called by <tt>xFunc</tt> to return a value.
-     * @param value
-     */
-    protected synchronized final void result(String value)
-        throws SQLException { checkContext(); db.result_text(context, value); }
-
-    /**
-     * Called by <tt>xFunc</tt> to throw an error.
-     * @param err
-     */
-    protected synchronized final void error(String err)
-        throws SQLException { checkContext(); db.result_error(context, err); }
-
-    /**
-     * Called by <tt>xFunc</tt> to access the value of an argument.
-     * @param arg
-     */
-    protected synchronized final int value_bytes(int arg)
-        throws SQLException {checkValue(arg); return db.value_bytes(this,arg);}
-
-    /**
-     * Called by <tt>xFunc</tt> to access the value of an argument.
-     * @param arg
-     */
-    protected synchronized final String value_text(int arg)
-        throws SQLException {checkValue(arg); return db.value_text(this,arg);}
-
-    /**
-     * Called by <tt>xFunc</tt> to access the value of an argument.
-     * @param arg
-     */
-    protected synchronized final byte[] value_blob(int arg)
-        throws SQLException {checkValue(arg); return db.value_blob(this,arg); }
-
-    /**
-     * Called by <tt>xFunc</tt> to access the value of an argument.
-     * @param arg
-     */
-    protected synchronized final double value_double(int arg)
-        throws SQLException {checkValue(arg); return db.value_double(this,arg);}
-
-    /**
-     * Called by <tt>xFunc</tt> to access the value of an argument.
-     * @param arg
-     */
-    protected synchronized final int value_int(int arg)
-        throws SQLException {checkValue(arg); return db.value_int(this, arg); }
-
-    /**
-     * Called by <tt>xFunc</tt> to access the value of an argument.
-     * @param arg
-     */
-    protected synchronized final long value_long(int arg)
-        throws SQLException { checkValue(arg); return db.value_long(this,arg); }
-
-    /**
-     * Called by <tt>xFunc</tt> to access the value of an argument.
-     * @param arg
-     */
-    protected synchronized final int value_type(int arg)
-        throws SQLException {checkValue(arg); return db.value_type(this,arg); }
-
-
-    /**
-     * @throws SQLException
-     */
-    private void checkContext() throws SQLException {
-        if (conn == null || conn.db() == null || context == 0) {
-            throw new SQLException("no context, not allowed to read value");
-        }
-    }
-
-    /**
-     * @param arg
-     * @throws SQLException
-     */
-    private void checkValue(int arg) throws SQLException {
-        if (conn == null || conn.db() == null || value == 0) {
-            throw new SQLException("not in value access state");
-        }
-        if (arg >= args) {
-            throw new SQLException("arg "+arg+" out bounds [0,"+args+")");
-        }
-    }
-
-
-    /**
-     * Provides an interface for creating SQLite user-defined aggregate functions.
-     * @see Function
-     */
-    public static abstract class Aggregate
-            extends Function
-            implements Cloneable
-    {
-        /**
-         * @see org.sqlite.Function#xFunc()
-         */
-        protected final void xFunc() {}
-
-        /**
-         * Defines the abstract aggregate callback function
-         * @throws SQLException
-         * @see <a href="http://www.sqlite.org/c3ref/aggregate_context.html">http://www.sqlite.org/c3ref/aggregate_context.html</a>
-         */
-        protected abstract void xStep() throws SQLException;
-
-        /**
-         * Defines the abstract aggregate callback function
-         * @throws SQLException
-         * @see <a href="http://www.sqlite.org/c3ref/aggregate_context.html">http://www.sqlite.org/c3ref/aggregate_context.html</a>
-         */
-        protected abstract void xFinal() throws SQLException;
-
-        /**
-         * @see java.lang.Object#clone()
-         */
-        public Object clone() throws CloneNotSupportedException {
-            return super.clone();
-        }
-    }
-}

BIN
jdbcsqlitenative/org/sqlite/JDBC.class


+ 0 - 116
jdbcsqlitenative/org/sqlite/JDBC.java

@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2007 David Crawshaw <david@zentus.com>
- * 
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package org.sqlite;
-
-import java.sql.*;
-import java.util.Properties;
-import java.util.logging.Logger;
-
-public class JDBC implements Driver
-{
-    public static final String PREFIX = "jdbc:sqlite:";
-
-    static {
-        try {
-            DriverManager.registerDriver(new JDBC());
-        }
-        catch (SQLException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * @see java.sql.Driver#getMajorVersion()
-     */
-    public int getMajorVersion() {
-        return SQLiteJDBCLoader.getMajorVersion();
-    }
-
-    /**
-     * @see java.sql.Driver#getMinorVersion()
-     */
-    public int getMinorVersion() {
-        return SQLiteJDBCLoader.getMinorVersion();
-    }
-
-    /**
-     * @see java.sql.Driver#jdbcCompliant()
-     */
-    public boolean jdbcCompliant() {
-        return false;
-    }
-    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
-        // TODO
-        return null;
-    }
-
-    /**
-     * @see java.sql.Driver#acceptsURL(java.lang.String)
-     */
-    public boolean acceptsURL(String url) {
-        return isValidURL(url);
-    }
-
-    /**
-     * Validates a URL
-     * @param url
-     * @return true if the URL is valid, false otherwise
-     */
-    public static boolean isValidURL(String url) {
-        return url != null && url.toLowerCase().startsWith(PREFIX);
-    }
-
-    /**
-     * @see java.sql.Driver#getPropertyInfo(java.lang.String, java.util.Properties)
-     */
-    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
-        return SQLiteConfig.getDriverPropertyInfo();
-    }
-
-    /**
-     * @see java.sql.Driver#connect(java.lang.String, java.util.Properties)
-     */
-    public Connection connect(String url, Properties info) throws SQLException {
-        return createConnection(url, info);
-    }
-
-    /**
-     * Gets the location to the database from a given URL.
-     * @param url The URL to extract the location from.
-     * @return The location to the database.
-     */
-    static String extractAddress(String url) {
-        // if no file name is given use a memory database
-        return PREFIX.equalsIgnoreCase(url) ? ":memory:" : url.substring(PREFIX.length());
-    }
-
-    /**
-     * Creates a new database connection to a given URL.
-     * @param url the URL
-     * @param prop the properties
-     * @return a Connection object that represents a connection to the URL
-     * @throws SQLException
-     * @see java.sql.Driver#connect(java.lang.String, java.util.Properties)
-     */
-    public static Connection createConnection(String url, Properties prop) throws SQLException {
-        if (!isValidURL(url))
-            return null;
-
-        url = url.trim();
-        return new SQLiteConnection(url, extractAddress(url), prop);
-    }
-}

BIN
jdbcsqlitenative/org/sqlite/SQLite.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig$DateClass.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig$DatePrecision.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig$Encoding.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig$JournalMode.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig$LockingMode.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig$Pragma.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig$PragmaValue.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig$SynchronousMode.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig$TempStore.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig$TransactionMode.class


BIN
jdbcsqlitenative/org/sqlite/SQLiteConfig.class


+ 0 - 801
jdbcsqlitenative/org/sqlite/SQLiteConfig.java

@@ -1,801 +0,0 @@
-/**
- *  Copyright 2009 Taro L. Saito
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *--------------------------------------------------------------------------*/
-//--------------------------------------
-// sqlite-jdbc Project
-//
-// SQLiteConfig.java
-// Since: Dec 8, 2009
-//
-// $URL$
-// $Author$
-//--------------------------------------
-package org.sqlite;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.DriverPropertyInfo;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.HashSet;
-import java.util.Properties;
-
-/**
- * SQLite Configuration
- *
- * See also http://www.sqlite.org/pragma.html
- *
- * @author leo
- *
- */
-public class SQLiteConfig
-{
-    private final Properties pragmaTable;
-    private int openModeFlag = 0x00;
-    private TransactionMode transactionMode;
-    public final int busyTimeout;
-
-    /* Date storage class*/
-    public final static String DEFAULT_DATE_STRING_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
-    public DateClass dateClass;
-    public DatePrecision datePrecision;
-    public long dateMultiplier;
-    public String dateStringFormat;
-
-    /**
-     * Default constructor.
-     */
-    public SQLiteConfig() {
-        this(new Properties());
-    }
-
-    /**
-     * Creates an SQLite configuration object using values from the given
-     * property object.
-     * @param prop The properties to apply to the configuration.
-     */
-    public SQLiteConfig(Properties prop) {
-        this.pragmaTable = prop;
-
-        String openMode = pragmaTable.getProperty(Pragma.OPEN_MODE.pragmaName);
-        if (openMode != null) {
-            openModeFlag = Integer.parseInt(openMode);
-        }
-        else {
-            // set the default open mode of SQLite3
-            setOpenMode(SQLiteOpenMode.READWRITE);
-            setOpenMode(SQLiteOpenMode.CREATE);
-        }
-        openMode = pragmaTable.getProperty(Pragma.SHARED_CACHE.pragmaName);
-        setOpenMode(SQLiteOpenMode.OPEN_URI); // Enable URI filenames
-
-        transactionMode = TransactionMode.getMode(
-                pragmaTable.getProperty(Pragma.TRANSACTION_MODE.pragmaName, TransactionMode.DEFFERED.name()));
-
-        dateClass = DateClass.getDateClass(pragmaTable.getProperty(Pragma.DATE_CLASS.pragmaName, DateClass.INTEGER.name()));
-        datePrecision = DatePrecision.getPrecision(pragmaTable.getProperty(Pragma.DATE_PRECISION.pragmaName, DatePrecision.MILLISECONDS.name()));
-        dateMultiplier = (datePrecision == DatePrecision.MILLISECONDS) ? 1L : 1000L;
-        dateStringFormat = pragmaTable.getProperty(Pragma.DATE_STRING_FORMAT.pragmaName, DEFAULT_DATE_STRING_FORMAT);
-
-        busyTimeout = Integer.parseInt(pragmaTable.getProperty(Pragma.BUSY_TIMEOUT.pragmaName, "3000"));
-    }
-
-    /**
-     * Create a new JDBC connection using the current configuration
-     * @return The connection.
-     * @throws SQLException
-     */
-    public Connection createConnection(String url) throws SQLException {
-        return JDBC.createConnection(url, toProperties());
-    }
-
-    /**
-     * Configures a connection.
-     * @param conn The connection to configure.
-     * @throws SQLException
-     */
-    public void apply(Connection conn) throws SQLException {
-
-        HashSet<String> pragmaParams = new HashSet<String>();
-        for (Pragma each : Pragma.values()) {
-            pragmaParams.add(each.pragmaName);
-        }
-
-        pragmaParams.remove(Pragma.OPEN_MODE.pragmaName);
-        pragmaParams.remove(Pragma.SHARED_CACHE.pragmaName);
-        pragmaParams.remove(Pragma.LOAD_EXTENSION.pragmaName);
-        pragmaParams.remove(Pragma.DATE_PRECISION.pragmaName);
-        pragmaParams.remove(Pragma.DATE_CLASS.pragmaName);
-        pragmaParams.remove(Pragma.DATE_STRING_FORMAT.pragmaName);
-
-        Statement stat = conn.createStatement();
-        try {
-            for (Object each : pragmaTable.keySet()) {
-                String key = each.toString();
-                if (!pragmaParams.contains(key)) {
-                    continue;
-                }
-
-                String value = pragmaTable.getProperty(key);
-                if (value != null) {
-                    stat.execute(String.format("pragma %s=%s", key, value));
-                }
-            }
-        }
-        finally {
-            if (stat != null) {
-                stat.close();
-            }
-        }
-
-    }
-
-    /**
-     * Sets a pragma to the given boolean value.
-     * @param pragma The pragma to set.
-     * @param flag The boolean value.
-     */
-    private void set(Pragma pragma, boolean flag) {
-        setPragma(pragma, Boolean.toString(flag));
-    }
-
-    /**
-     * Sets a pragma to the given int value.
-     * @param pragma The pragma to set.
-     * @param num The int value.
-     */
-    private void set(Pragma pragma, int num) {
-        setPragma(pragma, Integer.toString(num));
-    }
-
-    /**
-     * Checks if the provided value is the default for a given pragma.
-     * @param pragma The pragma on which to check.
-     * @param defaultValue The value to check for.
-     * @return True if the given value is the default value; false otherwise.
-     */
-    private boolean getBoolean(Pragma pragma, String defaultValue) {
-        return Boolean.parseBoolean(pragmaTable.getProperty(pragma.pragmaName, defaultValue));
-    }
-
-    /**
-     * Checks if the shared cache option is turned on.
-     * @return True if turned on; false otherwise.
-     */
-    public boolean isEnabledSharedCache() {
-        return getBoolean(Pragma.SHARED_CACHE, "false");
-    }
-
-    /**
-     * Checks if the load extension option is turned on.
-     * @return  True if turned on; false otherwise.
-     */
-    public boolean isEnabledLoadExtension() {
-        return getBoolean(Pragma.LOAD_EXTENSION, "false");
-    }
-
-    /**
-     * @return The open mode flags.
-     */
-    public int getOpenModeFlags() {
-        return openModeFlag;
-    }
-
-    /**
-     * Sets a pragma's value.
-     * @param pragma The pragma to change.
-     * @param value The value to set it to.
-     */
-    public void setPragma(Pragma pragma, String value) {
-        pragmaTable.put(pragma.pragmaName, value);
-    }
-
-    /**
-     * Convert this configuration into a Properties object, which can be
-     * passed to the {@link DriverManager#getConnection(String, Properties)}.
-     * @return The property object.
-     */
-    public Properties toProperties() {
-        pragmaTable.setProperty(Pragma.OPEN_MODE.pragmaName, Integer.toString(openModeFlag));
-        pragmaTable.setProperty(Pragma.TRANSACTION_MODE.pragmaName, transactionMode.getValue());
-        pragmaTable.setProperty(Pragma.DATE_CLASS.pragmaName, dateClass.getValue());
-        pragmaTable.setProperty(Pragma.DATE_PRECISION.pragmaName, datePrecision.getValue());
-        pragmaTable.setProperty(Pragma.DATE_STRING_FORMAT.pragmaName, dateStringFormat);
-
-        return pragmaTable;
-    }
-
-    /**
-     * @return Array of DriverPropertyInfo objects.
-     */
-    static DriverPropertyInfo[] getDriverPropertyInfo() {
-        Pragma[] pragma = Pragma.values();
-        DriverPropertyInfo[] result = new DriverPropertyInfo[pragma.length];
-        int index = 0;
-        for (Pragma p : Pragma.values()) {
-            DriverPropertyInfo di = new DriverPropertyInfo(p.pragmaName, null);
-            di.choices = p.choices;
-            di.description = p.description;
-            di.required = false;
-            result[index++] = di;
-        }
-
-        return result;
-    }
-
-    private static final String[] OnOff = new String[] { "true", "false" };
-
-    public static enum Pragma {
-
-        // Parameters requiring SQLite3 API invocation
-        OPEN_MODE("open_mode", "Database open-mode flag", null),
-        SHARED_CACHE("shared_cache", "Enable SQLite Shared-Cache mode, native driver only", OnOff),
-        LOAD_EXTENSION("enable_load_extension", "Enable SQLite load_extention() function, native driver only", OnOff),
-
-        // Pragmas that can be set after opening the database
-        CACHE_SIZE("cache_size"),
-        CASE_SENSITIVE_LIKE("case_sensitive_like", OnOff),
-        COUNT_CHANGES("count_changes", OnOff),
-        DEFAULT_CACHE_SIZE("default_cache_size"),
-        EMPTY_RESULT_CALLBACKS("empty_result_callback", OnOff),
-        ENCODING("encoding", toStringArray(Encoding.values())),
-        FOREIGN_KEYS("foreign_keys", OnOff),
-        FULL_COLUMN_NAMES("full_column_names", OnOff),
-        FULL_SYNC("fullsync", OnOff),
-        INCREMENTAL_VACUUM("incremental_vacuum"),
-        JOURNAL_MODE("journal_mode", toStringArray(JournalMode.values())),
-        JOURNAL_SIZE_LIMIT("journal_size_limit"),
-        LEGACY_FILE_FORMAT("legacy_file_format", OnOff),
-        LOCKING_MODE("locking_mode", toStringArray(LockingMode.values())),
-        PAGE_SIZE("page_size"),
-        MAX_PAGE_COUNT("max_page_count"),
-        READ_UNCOMMITED("read_uncommited", OnOff),
-        RECURSIVE_TRIGGERS("recursive_triggers", OnOff),
-        REVERSE_UNORDERED_SELECTS("reverse_unordered_selects", OnOff),
-        SHORT_COLUMN_NAMES("short_column_names", OnOff),
-        SYNCHRONOUS("synchronous", toStringArray(SynchronousMode.values())),
-        TEMP_STORE("temp_store", toStringArray(TempStore.values())),
-        TEMP_STORE_DIRECTORY("temp_store_directory"),
-        USER_VERSION("user_version"),
-
-        // Others
-        TRANSACTION_MODE("transaction_mode", toStringArray(TransactionMode.values())),
-        DATE_PRECISION("date_precision", "\"seconds\": Read and store integer dates as seconds from the Unix Epoch (SQLite standard).\n\"milliseconds\": (DEFAULT) Read and store integer dates as milliseconds from the Unix Epoch (Java standard).", toStringArray(DatePrecision.values())),
-        DATE_CLASS("date_class", "\"integer\": (Default) store dates as number of seconds or milliseconds from the Unix Epoch\n\"text\": store dates as a string of text\n\"real\": store dates as Julian Dates", toStringArray(DateClass.values())),
-        DATE_STRING_FORMAT("date_string_format", "Format to store and retrieve dates stored as text. Defaults to \"yyyy-MM-dd HH:mm:ss.SSS\"", null),
-        BUSY_TIMEOUT("busy_timeout", null);
-
-        public final String   pragmaName;
-        public final String[] choices;
-        public final String   description;
-
-        private Pragma(String pragmaName) {
-            this(pragmaName, null);
-        }
-
-        private Pragma(String pragmaName, String[] choices) {
-            this(pragmaName, null, choices);
-        }
-
-        private Pragma(String pragmaName, String description, String[] choices) {
-            this.pragmaName = pragmaName;
-            this.description = description;
-            this.choices = choices;
-        }
-
-        public final String getPragmaName()
-        {
-            return pragmaName;
-        }
-    }
-
-    /**
-     * Sets the open mode flags.
-     * @param mode The open mode.
-     * @see <a href="http://www.sqlite.org/c3ref/c_open_autoproxy.html">http://www.sqlite.org/c3ref/c_open_autoproxy.html</a>
-     */
-    public void setOpenMode(SQLiteOpenMode mode) {
-        openModeFlag |= mode.flag;
-    }
-
-    /**
-     * Re-sets the open mode flags.
-     * @param mode The open mode.
-     * @see <a href="http://www.sqlite.org/c3ref/c_open_autoproxy.html">http://www.sqlite.org/c3ref/c_open_autoproxy.html</a>
-     */
-    public void resetOpenMode(SQLiteOpenMode mode) {
-        openModeFlag &= ~mode.flag;
-    }
-
-    /**
-     * Enables or disables the sharing of the database cache and schema data
-     * structures between connections to the same database.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/c3ref/enable_shared_cache.html">www.sqlite.org/c3ref/enable_shared_cache.html</a>
-     */
-    public void setSharedCache(boolean enable) {
-        set(Pragma.SHARED_CACHE, enable);
-    }
-
-    /**
-     * Enables or disables extension loading.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/c3ref/load_extension.html">www.sqlite.org/c3ref/load_extension.html</a>
-     */
-    public void enableLoadExtension(boolean enable) {
-        set(Pragma.LOAD_EXTENSION, enable);
-    }
-
-    /**
-     * Sets the read-write mode for the database.
-     * @param readOnly True for read-only; otherwise read-write.
-     */
-    public void setReadOnly(boolean readOnly) {
-        if (readOnly) {
-            setOpenMode(SQLiteOpenMode.READONLY);
-            resetOpenMode(SQLiteOpenMode.CREATE);
-            resetOpenMode(SQLiteOpenMode.READWRITE);
-        }
-        else {
-            setOpenMode(SQLiteOpenMode.READWRITE);
-            setOpenMode(SQLiteOpenMode.CREATE);
-            resetOpenMode(SQLiteOpenMode.READONLY);
-        }
-    }
-
-    /**
-     * Changes the maximum number of database disk pages that SQLite will hold
-     * in memory at once per open database file.
-     * @param numberOfPages Cache size in number of pages.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_cache_size">www.sqlite.org/pragma.html#pragma_cache_size</a>
-     */
-    public void setCacheSize(int numberOfPages) {
-        set(Pragma.CACHE_SIZE, numberOfPages);
-    }
-
-    /**
-     * Enables or disables case sensitive for the LIKE operator.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_case_sensitive_like">www.sqlite.org/pragma.html#pragma_case_sensitive_like</a>
-     */
-    public void enableCaseSensitiveLike(boolean enable) {
-        set(Pragma.CASE_SENSITIVE_LIKE, enable);
-    }
-
-    /**
-     * @deprecated
-     * Enables or disables the count-changes flag. When enabled, INSERT, UPDATE
-     * and DELETE statements return the number of rows they modified.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_count_changes">www.sqlite.org/pragma.html#pragma_count_changes</a>
-     */
-    public void enableCountChanges(boolean enable) {
-        set(Pragma.COUNT_CHANGES, enable);
-    }
-
-    /**
-     * Sets the suggested maximum number of database disk pages that SQLite will
-     * hold in memory at once per open database file. The cache size set here
-     * persists across database connections.
-     * @param numberOfPages Cache size in number of pages.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_cache_size">www.sqlite.org/pragma.html#pragma_cache_size</a>
-     */
-    public void setDefaultCacheSize(int numberOfPages) {
-        set(Pragma.DEFAULT_CACHE_SIZE, numberOfPages);
-    }
-
-    /**
-     * @deprecated
-     * Enables or disables the empty_result_callbacks flag.
-     * @param enable True to enable; false to disable.
-     * false.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_empty_result_callbacks">http://www.sqlite.org/pragma.html#pragma_empty_result_callbacks</a>
-     */
-    public void enableEmptyResultCallBacks(boolean enable) {
-        set(Pragma.EMPTY_RESULT_CALLBACKS, enable);
-    }
-
-    /**
-     * The common interface for retrieving the available pragma parameter values.
-     * @author leo
-     */
-    private static interface PragmaValue
-    {
-        public String getValue();
-    }
-
-    /**
-     * Convert the given enum values to a string array
-     * @param list Array if PragmaValue.
-     * @return String array of Enum values
-     */
-    private static String[] toStringArray(PragmaValue[] list) {
-        String[] result = new String[list.length];
-        for (int i = 0; i < list.length; i++) {
-            result[i] = list[i].getValue();
-        }
-        return result;
-    }
-
-    public static enum Encoding implements PragmaValue {
-        UTF8("'UTF-8'"),
-        UTF16("'UTF-16'"),
-        UTF16_LITTLE_ENDIAN("'UTF-16le'"),
-        UTF16_BIG_ENDIAN("'UTF-16be'"),
-        UTF_8(UTF8),                    // UTF-8
-        UTF_16(UTF16),                  // UTF-16
-        UTF_16LE(UTF16_LITTLE_ENDIAN),  // UTF-16le
-        UTF_16BE(UTF16_BIG_ENDIAN);     // UTF-16be
-
-        public final String typeName;
-
-        private Encoding(String typeName) {
-            this.typeName = typeName;
-        }
-
-        private Encoding(Encoding encoding) {
-           this.typeName = encoding.getValue();
-        }
-
-        public String getValue() {
-            return typeName;
-        }
-
-        public static Encoding getEncoding(String value) {
-           return valueOf(value.replaceAll("-", "_").toUpperCase());
-        }
-    }
-
-    public static enum JournalMode implements PragmaValue {
-        DELETE, TRUNCATE, PERSIST, MEMORY, WAL, OFF;
-
-        public String getValue() {
-            return name();
-        }
-    }
-
-    /**
-     * Sets the text encoding used by the main database.
-     * @param encoding One of {@link Encoding}
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_encoding">www.sqlite.org/pragma.html#pragma_encoding</a>
-     */
-    public void setEncoding(Encoding encoding) {
-        setPragma(Pragma.ENCODING, encoding.typeName);
-    }
-
-    /**
-     * Whether to enforce foreign key constraints. This setting affects the
-     * execution of all statements prepared using the database connection,
-     * including those prepared before the setting was changed.
-     * @param enforce True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_foreign_keys">www.sqlite.org/pragma.html#pragma_foreign_keys</a>
-     */
-    public void enforceForeignKeys(boolean enforce) {
-        set(Pragma.FOREIGN_KEYS, enforce);
-    }
-
-    /**
-     * @deprecated
-     * Enables or disables the full_column_name flag. This flag together with
-     * the short_column_names flag determine the way SQLite assigns names to
-     * result columns of SELECT statements.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_full_column_names">www.sqlite.org/pragma.html#pragma_full_column_names</a>
-     */
-    public void enableFullColumnNames(boolean enable) {
-        set(Pragma.FULL_COLUMN_NAMES, enable);
-    }
-
-    /**
-     * Enables or disables the fullfsync flag. This flag determines whether or
-     * not the F_FULLFSYNC syncing method is used on systems that support it.
-     * The default value of the fullfsync flag is off. Only Mac OS X supports
-     * F_FULLFSYNC.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_fullfsync">www.sqlite.org/pragma.html#pragma_fullfsync</a>
-     */
-    public void enableFullSync(boolean enable) {
-        set(Pragma.FULL_SYNC, enable);
-    }
-
-    /**
-     * Sets the incremental_vacuum value; the number of pages to be removed from
-     * the <a href="http://www.sqlite.org/fileformat2.html#freelist">freelist</a>.
-     * The database file is truncated by the same amount.
-     * @param numberOfPagesToBeRemoved The number of pages to be removed.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_incremental_vacuum">www.sqlite.org/pragma.html#pragma_incremental_vacuum</a>
-     */
-    public void incrementalVacuum(int numberOfPagesToBeRemoved) {
-        set(Pragma.INCREMENTAL_VACUUM, numberOfPagesToBeRemoved);
-    }
-
-    /**
-     * Sets the journal mode for databases associated with the current database
-     * connection.
-     * @param mode One of {@link JournalMode}
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_journal_mode">www.sqlite.org/pragma.html#pragma_journal_mode</a>
-     */
-    public void setJournalMode(JournalMode mode) {
-        setPragma(Pragma.JOURNAL_MODE, mode.name());
-    }
-
-    //    public void setJournalMode(String databaseName, JournalMode mode) {
-    //        setPragma(databaseName, Pragma.JOURNAL_MODE, mode.name());
-    //    }
-
-    /**
-     * Sets the journal_size_limit. This setting limits the size of the
-     * rollback-journal and WAL files left in the file-system after transactions
-     * or checkpoints.
-     * @param limit Limit value in bytes. A negative number implies no limit.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_journal_size_limit">www.sqlite.org/pragma.html#pragma_journal_size_limit</a>
-     */
-    public void setJounalSizeLimit(int limit) {
-        set(Pragma.JOURNAL_SIZE_LIMIT, limit);
-    }
-
-    /**
-     * Sets the value of the legacy_file_format flag. When this flag is enabled,
-     * new SQLite databases are created in a file format that is readable and
-     * writable by all versions of SQLite going back to 3.0.0. When the flag is
-     * off, new databases are created using the latest file format which might
-     * not be readable or writable by versions of SQLite prior to 3.3.0.
-     * @param use True to turn on legacy file format; false to turn off.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_legacy_file_format">www.sqlite.org/pragma.html#pragma_legacy_file_format</a>
-     */
-    public void useLegacyFileFormat(boolean use) {
-        set(Pragma.LEGACY_FILE_FORMAT, use);
-    }
-
-    public static enum LockingMode implements PragmaValue {
-        NORMAL, EXCLUSIVE;
-        public String getValue() {
-            return name();
-        }
-    }
-
-    /**
-     * Sets the database connection locking-mode.
-     * @param mode One of {@link LockingMode}
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_locking_mode">www.sqlite.org/pragma.html#pragma_locking_mode</a>
-     */
-    public void setLockingMode(LockingMode mode) {
-        setPragma(Pragma.LOCKING_MODE, mode.name());
-    }
-
-    //    public void setLockingMode(String databaseName, LockingMode mode) {
-    //        setPragma(databaseName, Pragma.LOCKING_MODE, mode.name());
-    //    }
-
-    /**
-     * Sets the page size of the database. The page size must be a power of two
-     * between 512 and 65536 inclusive.
-     * @param numBytes A power of two between 512 and 65536 inclusive.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_page_size">www.sqlite.org/pragma.html#pragma_page_size</a>
-     */
-    public void setPageSize(int numBytes) {
-        set(Pragma.PAGE_SIZE, numBytes);
-    }
-
-    /**
-     * Sets the maximum number of pages in the database file.
-     * @param numPages Number of pages.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_max_page_count">www.sqlite.org/pragma.html#pragma_max_page_count</a>
-     */
-    public void setMaxPageCount(int numPages) {
-        set(Pragma.MAX_PAGE_COUNT, numPages);
-    }
-
-    /**
-     * Enables or disables useReadUncommitedIsolationMode.
-     * @param useReadUncommitedIsolationMode True to turn on; false to disable.
-     * disabled otherwise.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_read_uncommitted">www.sqlite.org/pragma.html#pragma_read_uncommitted</a>
-     */
-    public void setReadUncommited(boolean useReadUncommitedIsolationMode) {
-        set(Pragma.READ_UNCOMMITED, useReadUncommitedIsolationMode);
-    }
-
-    /**
-     * Enables or disables the recursive trigger capability.
-     * @param enable True to enable the recursive trigger capability.
-     * @see <a href="www.sqlite.org/pragma.html#pragma_recursive_triggers">www.sqlite.org/pragma.html#pragma_recursive_triggers</a>
-     */
-    public void enableRecursiveTriggers(boolean enable) {
-        set(Pragma.RECURSIVE_TRIGGERS, enable);
-    }
-
-    /**
-     * Enables or disables the reverse_unordered_selects flag. This setting
-     * causes SELECT statements without an ORDER BY clause to emit their results
-     * in the reverse order of what they normally would. This can help debug
-     * applications that are making invalid assumptions about the result order.
-     * @param enable True to enable reverse_unordered_selects.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_reverse_unordered_selects">www.sqlite.org/pragma.html#pragma_reverse_unordered_selects</a>
-     */
-    public void enableReverseUnorderedSelects(boolean enable) {
-        set(Pragma.REVERSE_UNORDERED_SELECTS, enable);
-    }
-
-    /**
-     * Enables or disables the short_column_names flag. This flag affects the
-     * way SQLite names columns of data returned by SELECT statements.
-     * @param enable True to enable short_column_names.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_short_column_names">www.sqlite.org/pragma.html#pragma_short_column_names</a>
-     */
-    public void enableShortColumnNames(boolean enable) {
-        set(Pragma.SHORT_COLUMN_NAMES, enable);
-    }
-
-    public static enum SynchronousMode implements PragmaValue {
-        OFF, NORMAL, FULL;
-
-        public String getValue() {
-            return name();
-        }
-    }
-
-    /**
-     * Changes the setting of the "synchronous" flag.
-     * @param mode One of {@link SynchronousMode}:<ul>
-     * <li> OFF - SQLite continues without syncing as soon as it has handed
-     * data off to the operating system</li>
-     * <li> NORMAL - the SQLite database engine will still sync at the most
-     * critical moments, but less often than in FULL mode</li>
-     * <li> FULL - the SQLite database engine will use the xSync method of the
-     * VFS to ensure that all content is safely written to the disk surface
-     * prior to continuing. This ensures that an operating system crash or power
-     * failure will not corrupt the database.</li></ul>
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_synchronous">www.sqlite.org/pragma.html#pragma_synchronous</a>
-     */
-    public void setSynchronous(SynchronousMode mode) {
-        setPragma(Pragma.SYNCHRONOUS, mode.name());
-    }
-
-    public static enum TempStore implements PragmaValue {
-        DEFAULT, FILE, MEMORY;
-
-        public String getValue() {
-            return name();
-        }
-
-    }
-
-    /**
-     * Changes the setting of the "temp_store" parameter.
-     * @param storeType One of {@link TempStore}:<ul>
-     * <li> DEFAULT - the compile-time C preprocessor macro SQLITE_TEMP_STORE
-     * is used to determine where temporary tables and indices are stored</li>
-     * <li>FILE - temporary tables and indices are kept in as if they were pure
-     * in-memory databases memory</li>
-     * <li>MEMORY - temporary tables and indices are stored in a file.</li></ul>
-     * @see <a
-     *      href="http://www.sqlite.org/pragma.html#pragma_temp_store">www.sqlite.org/pragma.html#pragma_temp_store</a>
-     */
-    public void setTempStore(TempStore storeType) {
-        setPragma(Pragma.TEMP_STORE, storeType.name());
-    }
-
-    /**
-     * Changes the value of the sqlite3_temp_directory global variable, which many operating-system
-     * interface backends use to determine where to store temporary tables and indices.
-     * @param directoryName Directory name for storing temporary tables and indices.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_temp_store_directory">www.sqlite.org/pragma.html#pragma_temp_store_directory</a>
-     */
-    public void setTempStoreDirectory(String directoryName) {
-        setPragma(Pragma.TEMP_STORE_DIRECTORY, String.format("'%s'", directoryName));
-    }
-
-    /**
-     * Set the value of the user-version. The user-version is not used
-     * internally by SQLite. It may be used by applications for any purpose. The
-     * value is stored in the database header at offset 60.
-     * @param version A big-endian 32-bit signed integer.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_user_version">www.sqlite.org/pragma.html#pragma_user_version</a>
-     */
-    public void setUserVersion(int version) {
-        set(Pragma.USER_VERSION, version);
-    }
-
-    public static enum TransactionMode implements PragmaValue {
-        DEFFERED, IMMEDIATE, EXCLUSIVE;
-
-        public String getValue() {
-            return name();
-        }
-
-        public static TransactionMode getMode(String mode) {
-            return TransactionMode.valueOf(mode.toUpperCase());
-        }
-    }
-
-    /**
-     * Sets the mode that will be used to start transactions.
-     * @param transactionMode One of {@link TransactionMode}.
-     * @see <a href="http://www.sqlite.org/lang_transaction.html">http://www.sqlite.org/lang_transaction.html</a>
-     */
-    public void setTransactionMode(TransactionMode transactionMode) {
-        this.transactionMode = transactionMode;
-    }
-
-    /**
-     * Sets the mode that will be used to start transactions.
-     * @param transactionMode One of DEFFERED, IMMEDIATE or EXCLUSIVE.
-     * @see <a href="http://www.sqlite.org/lang_transaction.html">http://www.sqlite.org/lang_transaction.html</a>
-     */
-    public void setTransactionMode(String transactionMode) {
-        setTransactionMode(TransactionMode.getMode(transactionMode));
-    }
-
-    /**
-     * @return The transaction mode.
-     */
-    public TransactionMode getTransactionMode() {
-        return transactionMode;
-    }
-
-    public static enum DatePrecision implements PragmaValue {
-        SECONDS, MILLISECONDS;
-
-        public String getValue() {
-            return name();
-        }
-
-        public static DatePrecision getPrecision(String precision) {
-            return DatePrecision.valueOf(precision.toUpperCase());
-        }
-    }
- 
-    /**
-     * @param datePrecision One of SECONDS or MILLISECONDS
-     * @throws SQLException 
-     */
-    public void setDatePrecision(String datePrecision) throws SQLException {
-        this.datePrecision = DatePrecision.getPrecision(datePrecision);
-    }
-
-    public static enum DateClass implements PragmaValue {
-        INTEGER, TEXT, REAL;
-
-        public String getValue() {
-            return name();
-        }
-
-        public static DateClass getDateClass(String dateClass) {
-            return DateClass.valueOf(dateClass.toUpperCase());
-        }
-    }
-
-    /**
-     * @param dateClass One of INTEGER, TEXT or REAL
-     */
-    public void setDateClass(String dateClass) {
-        this.dateClass = DateClass.getDateClass(dateClass);
-    }
-
-    /**
-     * @param dateStringFormat Format of date string
-     */
-    public void setDateStringFormat(String dateStringFormat) {
-        this.dateStringFormat = dateStringFormat;
-    }
-
-    /**
-     * @param milliseconds Connect to DB timeout in milliseconds
-     */
-    public void setBusyTimeout(String milliseconds) {
-        setPragma(Pragma.BUSY_TIMEOUT, milliseconds);
-    }
-}

BIN
jdbcsqlitenative/org/sqlite/SQLiteConnection.class


+ 0 - 64
jdbcsqlitenative/org/sqlite/SQLiteConnection.java

@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2007 David Crawshaw <david@zentus.com>
- * 
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-package org.sqlite;
-
-import java.sql.SQLException;
-import java.util.Properties;
-import java.util.concurrent.Executor;
-
-import org.sqlite.jdbc4.JDBC4Connection;
-
-public class SQLiteConnection extends JDBC4Connection
-{
-    /**
-     * Constructor to create a connection to a database at the given location.
-     * @param url The location of the database.
-     * @param fileName The database.
-     * @throws SQLException
-     */
-    public SQLiteConnection(String url, String fileName) throws SQLException {
-        this(url, fileName, new Properties());
-    }
-
-    /**
-     * Constructor to create a pre-configured connection to a database at the
-     * given location.
-     * @param url The location of the database file.
-     * @param fileName The database.
-     * @param prop The configurations to apply.
-     * @throws SQLException
-     */
-    public SQLiteConnection(String url, String fileName, Properties prop) throws SQLException {
-        super(url, fileName, prop);
-    }
-    public void setSchema(String schema) throws SQLException {
-        // TODO
-    }
-    public String getSchema() throws SQLException {
-        // TODO
-        return null;
-    }
-    public void abort(Executor executor) throws SQLException {
-        // TODO
-    }
-    public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
-        // TODO
-    }
-    public int getNetworkTimeout() throws SQLException {
-        // TODO
-        return 0;
-    }
-}

BIN
jdbcsqlitenative/org/sqlite/SQLiteDataSource.class


+ 0 - 466
jdbcsqlitenative/org/sqlite/SQLiteDataSource.java

@@ -1,466 +0,0 @@
-/*--------------------------------------------------------------------------
- *  Copyright 2010 Taro L. Saito
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *--------------------------------------------------------------------------*/
-//--------------------------------------
-// sqlite-jdbc Project
-//
-// SQLiteDataSource.java
-// Since: Mar 11, 2010
-//
-// $URL$ 
-// $Author$
-//--------------------------------------
-package org.sqlite;
-
-import org.sqlite.SQLiteConfig.*;
-
-import javax.sql.DataSource;
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
-import java.util.Properties;
-import java.util.logging.Logger;
-
-/**
- * Provides {@link DataSource} API for configuring SQLite database connection
- * 
- * @author leo
- * 
- */
-public class SQLiteDataSource implements DataSource
-{
-    private SQLiteConfig          config;
-    private transient PrintWriter logger;
-    private int                   loginTimeout = 1;
-
-    private String                url          = JDBC.PREFIX; // use memory database in default
-    private String                databaseName = ""; // the name of the current database
-
-    /**
-     * Default constructor.
-     */
-    public SQLiteDataSource() {
-        this.config = new SQLiteConfig(); // default configuration
-    }
-
-    /**
-     * Creates a data source based on the provided configuration.
-     * @param config The configuration for the data source.
-     */
-    public SQLiteDataSource(SQLiteConfig config) {
-        this.config = config;
-    }
-
-    /**
-     * Sets a data source's configuration.
-     * @param config The configuration.
-     */
-    public void setConfig(SQLiteConfig config) {
-        this.config = config;
-    }
-
-    /**
-     * @return The configuration for the data source.
-     */
-    public SQLiteConfig getConfig() {
-        return config;
-    }
-
-    /**
-     * Sets the location of the database file.
-     * @param url The location of the database file.
-     */
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    /**
-     * @return The location of the database file.
-     */
-    public String getUrl() {
-        return url;
-    }
-
-    /**
-     * Sets the database name.
-     * @param databaseName The name of the database
-     */
-    public void setDatabaseName(String databaseName) {
-        this.databaseName = databaseName;
-    }
-
-    /**
-     * @return The name of the database if one was set.
-     * @see SQLiteDataSource#setDatabaseName(String)
-     */
-    public String getDatabaseName() {
-        return databaseName;
-    }
-
-    /**
-     * Enables or disables the sharing of the database cache and schema data
-     * structures between connections to the same database. 
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/c3ref/enable_shared_cache.html">http://www.sqlite.org/c3ref/enable_shared_cache.html</a>
-     */
-    public void setSharedCache(boolean enable) {
-        config.setSharedCache(enable);
-    }
-
-    /**
-     * Enables or disables extension loading.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/c3ref/load_extension.html">http://www.sqlite.org/c3ref/load_extension.html</a>
-     */
-    public void setLoadExtension(boolean enable) {
-        config.enableLoadExtension(enable);
-    }
-
-    /**
-     * Sets the database to be opened in read-only mode 
-     * @param readOnly True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/c3ref/c_open_autoproxy.html">http://www.sqlite.org/c3ref/c_open_autoproxy.html</a>
-     */
-    public void setReadOnly(boolean readOnly) {
-        config.setReadOnly(readOnly);
-    }
-
-    /**
-     * Sets the suggested maximum number of database disk pages that SQLite will
-     * hold in memory at once per open database file. 
-     * @param numberOfPages The number of database disk pages.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_cache_size">http://www.sqlite.org/pragma.html#pragma_cache_size</a>
-     */
-    public void setCacheSize(int numberOfPages) {
-        config.setCacheSize(numberOfPages);
-    }
-
-    /**
-     * Enables or disables case sensitivity for the built-in LIKE operator.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/compile.html#case_sensitive_like">http://www.sqlite.org/compile.html#case_sensitive_like</a>
-     */
-    public void setCaseSensitiveLike(boolean enable) {
-        config.enableCaseSensitiveLike(enable);
-    }
-
-    /**
-     * Enables or disables the count-changes flag. When enabled INSERT, UPDATE
-     * and DELETE statements return the number of rows they modified.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_count_changes">http://www.sqlite.org/pragma.html#pragma_count_changes</a>
-     */
-    public void setCouncChanges(boolean enable) {
-        config.enableCountChanges(enable);
-    }
-
-    /**
-     * Sets the default maximum number of database disk pages that SQLite will
-     * hold in memory at once per open database file. 
-     * @param numberOfPages The default suggested cache size.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_cache_size">http://www.sqlite.org/pragma.html#pragma_cache_size</a>
-     */
-    public void setDefaultCacheSize(int numberOfPages) {
-        config.setDefaultCacheSize(numberOfPages);
-    }
-
-    /**
-     * Sets the text encoding used by the main database. 
-     * @param encoding One of "UTF-8", "UTF-16le" (little-endian UTF-16)
-     * or "UTF-16be" (big-endian UTF-16).
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_encoding">
-     * http://www.sqlite.org/pragma.html#pragma_encoding</a>
-     */
-    public void setEncoding(String encoding) {
-        config.setEncoding(Encoding.getEncoding(encoding));
-    }
-
-    /**
-     * Enables or disables the enforcement of foreign key constraints. 
-     * @param enforce True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_foreign_keys">
-     * http://www.sqlite.org/pragma.html#pragma_foreign_keys</a>
-     */
-    public void setEnforceForeinKeys(boolean enforce) {
-        config.enforceForeignKeys(enforce);
-    }
-
-    /**
-     * Enables or disables the full_column_names flag. This flag together with 
-     * the short_column_names flag determine the way SQLite assigns names to
-     * result columns of SELECT statements.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_full_column_names">http://www.sqlite.org/pragma.html#pragma_full_column_names</a>
-     */
-    public void setFullColumnNames(boolean enable) {
-        config.enableFullColumnNames(enable);
-    }
-
-    /**
-     * Enables or disables the fullfsync flag. This flag determines whether or 
-     * not the F_FULLFSYNC syncing method is used on systems that support it.
-     * @param enable True to enable; false to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_fullfsync">http://www.sqlite.org/pragma.html#pragma_fullfsync</a>
-     */
-    public void setFullSync(boolean enable) {
-        config.enableFullSync(enable);
-    }
-
-    /**
-     * Set the incremental_vacuum value that causes up to N pages to be removed
-     * from the 
-     * <a href="http://www.sqlite.org/fileformat2.html#freelist">http://www.sqlite.org/fileformat2.html#freelist</a>.
-     * @param numberOfPagesToBeRemoved 
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_incremental_vacuum">
-     * http://www.sqlite.org/pragma.html#pragma_incremental_vacuum</a>
-     */
-    public void setIncrementalVacuum(int numberOfPagesToBeRemoved) {
-        config.incrementalVacuum(numberOfPagesToBeRemoved);
-    }
-
-    /**
-     * Sets the journal mode for databases associated with the current database
-     * connection.
-     * @param mode One of DELETE, TRUNCATE, PERSIST, MEMORY, WAL or OFF. 
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_journal_mode">
-     * http://www.sqlite.org/pragma.html#pragma_journal_mode</a>
-     */
-    public void setJournalMode(String mode) {
-        config.setJournalMode(JournalMode.valueOf(mode));
-    }
-
-    /**
-     * Sets the limit of the size of rollback-journal and WAL files left in the
-     * file-system after transactions or checkpoints.
-     * @param limit The default journal size limit is -1 (no limit).
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_journal_size_limit">
-     * http://www.sqlite.org/pragma.html#pragma_journal_size_limit</a>
-     */
-    public void setJournalSizeLimit(int limit) {
-        config.setJounalSizeLimit(limit);
-    }
-
-    /**
-     * Set the value of the legacy_file_format flag. When this flag is on, new
-     * databases are created in a file format that is readable and writable by
-     * all versions of SQLite going back to 3.0.0. When the flag is off, new
-     * databases are created using the latest file format which might not be
-     * readable or writable by versions of SQLite prior to 3.3.0.
-     * @param use True to turn on; false to turn off.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_legacy_file_format">http://www.sqlite.org/pragma.html#pragma_legacy_file_format</a>
-     */
-    public void setLegacyFileFormat(boolean use) {
-        config.useLegacyFileFormat(use);
-    }
-
-    /**
-     * Sets the database connection locking-mode.
-     * @param mode Either NORMAL or EXCLUSIVE.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_locking_mode">
-     * http://www.sqlite.org/pragma.html#pragma_locking_mode</a>
-     */
-    public void setLockingMode(String mode) {
-        config.setLockingMode(LockingMode.valueOf(mode));
-    }
-
-    /**
-     * Set the page size of the database.  
-     * @param numBytes The page size must be a power of two between 512 and 65536 inclusive.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_page_size">
-     * http://www.sqlite.org/pragma.html#pragma_page_size</a>
-     */
-    public void setPageSize(int numBytes) {
-        config.setPageSize(numBytes);
-    }
-
-    /**
-     * Set the maximum number of pages in the database file.
-     * @param numPages The maximum page count cannot be reduced below the current database size. 
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_max_page_count">
-     * http://www.sqlite.org/pragma.html#pragma_max_page_count</a>
-     */
-    public void setMaxPageCount(int numPages) {
-        config.setMaxPageCount(numPages);
-    }
-
-    /**
-     * Set READ UNCOMMITTED isolation
-     * @param useReadUncommitedIsolationMode True to turn on; false to turn off. 
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_read_uncommitted">http://www.sqlite.org/pragma.html#pragma_read_uncommitted</a>
-     */
-    public void setReadUncommited(boolean useReadUncommitedIsolationMode) {
-        config.setReadUncommited(useReadUncommitedIsolationMode);
-    }
-
-    /**
-     * Enables or disables the recursive trigger capability. Changing the
-     * recursive_triggers setting affects the execution of all statements
-     * prepared using the database connection, including those prepared before
-     * the setting was changed.
-     * @param enable True to enable; fase to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_recursive_triggers">http://www.sqlite.org/pragma.html#pragma_recursive_triggers</a>
-     */
-    public void setRecursiveTriggers(boolean enable) {
-        config.enableRecursiveTriggers(enable);
-    }
-
-    /**
-     * Enables or disables the reverse_unordered_selects flag. When enabled it
-     * causes SELECT statements without an ORDER BY clause to emit their results
-     * in the reverse order of what they normally would.
-     * @param enable True to enable; fase to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_reverse_unordered_selects">http://www.sqlite.org/pragma.html#pragma_reverse_unordered_selects</a>
-     */
-    public void setReverseUnorderedSelects(boolean enable) {
-        config.enableReverseUnorderedSelects(enable);
-    }
-
-    /**
-     * Enables or disables the short_column_names flag. This flag affects the
-     * way SQLite names columns of data returned by SELECT statements.
-     * @param enable True to enable; fase to disable.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_short_column_names">http://www.sqlite.org/pragma.html#pragma_short_column_names</a>
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_fullfsync">http://www.sqlite.org/pragma.html#pragma_fullfsync</a>
-     */
-    public void setShortColumnNames(boolean enable) {
-        config.enableShortColumnNames(enable);
-    }
-
-    /**
-     * Sets the setting of the "synchronous" flag.
-     * @param mode One of OFF, NORMAL or FULL;
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_synchronous">
-     * http://www.sqlite.org/pragma.html#pragma_synchronous</a>
-     */
-    public void setSynchronous(String mode) {
-        config.setSynchronous(SynchronousMode.valueOf(mode));
-    }
-
-    /**
-     * Set the temp_store type which is used to determine where temporary tables
-     * and indices are stored.
-     * @param storeType One of "DEFAULT", "FILE", "MEMORY"
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_temp_store">http://www.sqlite.org/pragma.html#pragma_temp_store</a>
-     */
-    public void setTempStore(String storeType) {
-        config.setTempStore(TempStore.valueOf(storeType));
-    }
-
-    /**
-     * Set the value of the sqlite3_temp_directory global variable, which many
-     * operating-system interface backends use to determine where to store
-     * temporary tables and indices.
-     * @param directoryName The temporary directory name.
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_temp_store_directory">http://www.sqlite.org/pragma.html#pragma_temp_store_directory</a>
-     */
-    public void setTempStoreDirectory(String directoryName) {
-        config.setTempStoreDirectory(directoryName);
-    }
-
-    /**
-     * Sets the mode that will be used to start transactions for this database.
-     * @param transactionMode One of DEFFERED, IMMEDIATE or EXCLUSIVE.
-     * @see <a href="http://www.sqlite.org/lang_transaction.html">http://www.sqlite.org/lang_transaction.html</a>
-     */
-    public void setTransactionMode(String transactionMode) {
-        config.setTransactionMode(transactionMode);
-    }
-
-    /**
-     * Sets the value of the user-version. It is a big-endian 32-bit signed
-     * integer stored in the database header at offset 60. 
-     * @param version
-     * @see <a href="http://www.sqlite.org/pragma.html#pragma_schema_version">http://www.sqlite.org/pragma.html#pragma_schema_version</a>
-     */
-    public void setUserVersion(int version) {
-        config.setUserVersion(version);
-    }
-
-    // codes for the DataSource interface    
-
-    /**
-     * @see javax.sql.DataSource#getConnection()
-     */
-    public Connection getConnection() throws SQLException {
-        return getConnection(null, null);
-    }
-
-    /**
-     * @see javax.sql.DataSource#getConnection(java.lang.String, java.lang.String)
-     */
-    public Connection getConnection(String username, String password) throws SQLException {
-        Properties p = config.toProperties();
-        if (username != null)
-            p.put("user", username);
-        if (password != null)
-            p.put("pass", password);
-        return JDBC.createConnection(url, p);
-    }
-
-    /**
-     * @see javax.sql.DataSource#getLogWriter()
-     */
-    public PrintWriter getLogWriter() throws SQLException {
-        return logger;
-    }
-
-    /**
-     * @see javax.sql.DataSource#getLoginTimeout()
-     */
-    public int getLoginTimeout() throws SQLException {
-        return loginTimeout;
-    }
-
-    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
-        throw new SQLFeatureNotSupportedException("getParentLogger");
-    }
-
-    /**
-     * @see javax.sql.DataSource#setLogWriter(java.io.PrintWriter)
-     */
-    public void setLogWriter(PrintWriter out) throws SQLException {
-        this.logger = out;
-    }
-
-    /**
-     * @see javax.sql.DataSource#setLoginTimeout(int)
-     */
-    public void setLoginTimeout(int seconds) throws SQLException {
-        loginTimeout = seconds;
-    }
-
-    /**
-     * Determines if this object wraps a given class.
-     * @param iface The class to check.
-     * @return True if it is an instance of the current class; false otherwise.
-     * @throws SQLException
-     */
-    public boolean isWrapperFor(Class< ? > iface) throws SQLException {
-        return iface.isInstance(this);
-    }
-
-    /**
-     * Casts this object to the given class.
-     * @param iface The class to cast to.
-     * @return The casted class.
-     * @throws SQLException
-     */
-    @SuppressWarnings("unchecked")
-    public <T> T unwrap(Class<T> iface) throws SQLException {
-        return (T) this;
-    }
-
-}

BIN
jdbcsqlitenative/org/sqlite/SQLiteErrorCode.class


+ 0 - 104
jdbcsqlitenative/org/sqlite/SQLiteErrorCode.java

@@ -1,104 +0,0 @@
-/*--------------------------------------------------------------------------
- *  Copyright 2009 Taro L. Saito
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *--------------------------------------------------------------------------*/
-//--------------------------------------
-// sqlite-jdbc Project
-//
-// SQLiteErrorCode.java
-// Since: Apr 21, 2009
-//
-// $URL$ 
-// $Author$
-//--------------------------------------
-package org.sqlite;
-
-/**
- * SQLite3 error code
- * 
- * @author leo
- * @see <a href="http://www.sqlite.org/c3ref/c_abort.html">http://www.sqlite.org/c3ref/c_abort.html</a>
- * 
- */
-public enum SQLiteErrorCode {
-
-    UNKNOWN_ERROR(-1, "unknown error"),
-    SQLITE_OK(0, "Successful result"),
-    /* beginning-of-error-codes */
-    SQLITE_ERROR(1, "SQL error or missing database"),
-    SQLITE_INTERNAL(2, "Internal logic error in SQLite"),
-    SQLITE_PERM(3, " Access permission denied"),
-    SQLITE_ABORT(4, " Callback routine requested an abort"),
-    SQLITE_BUSY(5, " The database file is locked"),
-    SQLITE_LOCKED(6, " A table in the database is locked"),
-    SQLITE_NOMEM(7, " A malloc() failed"),
-    SQLITE_READONLY(8, " Attempt to write a readonly database"),
-    SQLITE_INTERRUPT(9, " Operation terminated by sqlite3_interrupt()"),
-    SQLITE_IOERR(10, " Some kind of disk I/O error occurred"),
-    SQLITE_CORRUPT(11, " The database disk image is malformed"),
-    SQLITE_NOTFOUND(12, " NOT USED. Table or record not found"),
-    SQLITE_FULL(13, " Insertion failed because database is full"),
-    SQLITE_CANTOPEN(14, " Unable to open the database file"),
-    SQLITE_PROTOCOL(15, " NOT USED. Database lock protocol error"),
-    SQLITE_EMPTY(16, " Database is empty"),
-    SQLITE_SCHEMA(17, " The database schema changed"),
-    SQLITE_TOOBIG(18, " String or BLOB exceeds size limit"),
-    SQLITE_CONSTRAINT(19, " Abort due to constraint violation"),
-    SQLITE_MISMATCH(20, " Data type mismatch"),
-    SQLITE_MISUSE(21, " Library used incorrectly"),
-    SQLITE_NOLFS(22, " Uses OS features not supported on host"),
-    SQLITE_AUTH(23, " Authorization denied"),
-    SQLITE_FORMAT(24, " Auxiliary database format error"),
-    SQLITE_RANGE(25, " 2nd parameter to sqlite3_bind out of range"),
-    SQLITE_NOTADB(26, " File opened that is not a database file"),
-    SQLITE_ROW(100, " sqlite3_step() has another row ready"),
-    SQLITE_DONE(101, " sqlite3_step() has finished executing");
-
-    public final int code;
-    public final String message;
-
-    /**
-     * Constructor that applies error code and message.
-     * @param code Error code.
-     * @param message Message for the error.
-     */
-    private SQLiteErrorCode(int code, String message)
-    {
-        this.code = code;
-        this.message = message;
-    }
-
-    /**
-     * @param errorCode Error code.
-     * @return Error message.
-     */
-    public static SQLiteErrorCode getErrorCode(int errorCode)
-    {
-        for (SQLiteErrorCode each : SQLiteErrorCode.values())
-        {
-            if (errorCode == each.code)
-                return each;
-        }
-        return UNKNOWN_ERROR;
-    }
-
-    /**
-     * @see java.lang.Enum#toString()
-     */
-    @Override
-    public String toString()
-    {
-        return String.format("[%s] %s", this.name(), message);
-    }
-}

BIN
jdbcsqlitenative/org/sqlite/SQLiteJDBCLoader.class


+ 0 - 350
jdbcsqlitenative/org/sqlite/SQLiteJDBCLoader.java

@@ -1,350 +0,0 @@
-/*--------------------------------------------------------------------------
- *  Copyright 2007 Taro L. Saito
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *--------------------------------------------------------------------------*/
-//--------------------------------------
-// SQLite JDBC Project
-//
-// SQLite.java
-// Since: 2007/05/10
-//
-// $URL$ 
-// $Author$
-//--------------------------------------
-package org.sqlite;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.DigestInputStream;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Properties;
-import java.util.UUID;
-
-import org.sqlite.util.OSInfo;
-
-/**
- * Set the system properties, org.sqlite.lib.path, org.sqlite.lib.name,
- * appropriately so that the SQLite JDBC driver can find *.dll, *.jnilib and
- * *.so files, according to the current OS (win, linux, mac).
- * <p/>
- * The library files are automatically extracted from this project's package
- * (JAR).
- * <p/>
- * usage: call {@link #initialize()} before using SQLite JDBC driver.
- *
- * @author leo
- */
-public class SQLiteJDBCLoader {
-
-    private static boolean extracted = false;
-
-    /**
-     * Loads SQLite native JDBC library.
-     *
-     * @return True if SQLite native library is successfully loaded; false otherwise.
-     */
-    public static boolean initialize() throws Exception {
-        loadSQLiteNativeLibrary();
-        return extracted;
-    }
-
-    /**
-     * @return True if the SQLite JDBC driver is set to pure Java mode; false otherwise.
-     * @deprecated Pure Java no longer supported
-     */
-    static boolean getPureJavaFlag() {
-        return Boolean.parseBoolean(System.getProperty("sqlite.purejava", "false"));
-    }
-
-    /**
-     * Checks if the SQLite JDBC driver is set to pure Java mode.
-     *
-     * @return True if the SQLite JDBC driver is set to pure Java mode; false otherwise.
-     * @deprecated Pure Java nolonger supported
-     */
-    public static boolean isPureJavaMode() {
-        return false;
-    }
-
-    /**
-     * Checks if the SQLite JDBC driver is set to native mode.
-     *
-     * @return True if the SQLite JDBC driver is set to native Java mode; false otherwise.
-     */
-    public static boolean isNativeMode() throws Exception {
-        // load the driver
-        initialize();
-        return extracted;
-    }
-
-    /**
-     * Computes the MD5 value of the input stream.
-     *
-     * @param input InputStream.
-     * @return Encrypted string for the InputStream.
-     * @throws IOException
-     * @throws NoSuchAlgorithmException
-     */
-    static String md5sum(InputStream input) throws IOException {
-        BufferedInputStream in = new BufferedInputStream(input);
-
-        try {
-            MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
-            DigestInputStream digestInputStream = new DigestInputStream(in, digest);
-            for(; digestInputStream.read() >= 0; ) {
-
-            }
-            ByteArrayOutputStream md5out = new ByteArrayOutputStream();
-            md5out.write(digest.digest());
-            return md5out.toString();
-        } catch(NoSuchAlgorithmException e) {
-            throw new IllegalStateException("MD5 algorithm is not available: " + e);
-        } finally {
-            in.close();
-        }
-    }
-
-    private static boolean contentsEquals(InputStream in1, InputStream in2) throws IOException {
-        if(!(in1 instanceof BufferedInputStream)) {
-            in1 = new BufferedInputStream(in1);
-        }
-        if(!(in2 instanceof BufferedInputStream)) {
-            in2 = new BufferedInputStream(in2);
-        }
-
-        int ch = in1.read();
-        while(ch != -1) {
-            int ch2 = in2.read();
-            if(ch != ch2) {
-                return false;
-            }
-            ch = in1.read();
-        }
-        int ch2 = in2.read();
-        return ch2 == -1;
-    }
-
-    /**
-     * Extracts and loads the specified library file to the target folder
-     *
-     * @param libFolderForCurrentOS Library path.
-     * @param libraryFileName       Library name.
-     * @param targetFolder          Target folder.
-     * @return
-     */
-    private static boolean extractAndLoadLibraryFile(String libFolderForCurrentOS, String libraryFileName,
-                                                     String targetFolder) {
-        String nativeLibraryFilePath = libFolderForCurrentOS + "/" + libraryFileName;
-        // Include architecture name in temporary filename in order to avoid conflicts
-        // when multiple JVMs with different architectures running at the same time
-        String uuid = UUID.randomUUID().toString();
-        String extractedLibFileName = String.format("sqlite-%s-%s-%s", getVersion(), uuid, libraryFileName);
-        File extractedLibFile = new File(targetFolder, extractedLibFileName);
-
-        try {
-            // Extract a native library file into the target directory
-            InputStream reader = SQLiteJDBCLoader.class.getResourceAsStream(nativeLibraryFilePath);
-            FileOutputStream writer = new FileOutputStream(extractedLibFile);
-            try {
-                byte[] buffer = new byte[8192];
-                int bytesRead = 0;
-                while((bytesRead = reader.read(buffer)) != -1) {
-                    writer.write(buffer, 0, bytesRead);
-                }
-            } finally {
-                // Delete the extracted lib file on JVM exit.
-                extractedLibFile.deleteOnExit();
-
-                if(writer != null) {
-                    writer.close();
-                }
-                if(reader != null) {
-                    reader.close();
-                }
-            }
-
-            // Set executable (x) flag to enable Java to load the native library
-            extractedLibFile.setReadable(true);
-            extractedLibFile.setWritable(true, true);
-            extractedLibFile.setExecutable(true);
-
-
-            // Check whether the contents are properly copied from the resource folder
-