summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--JavaLibrary.mk39
-rwxr-xr-xrun-core-tests3
-rw-r--r--sql/src/main/native/sqlite_jni_registration.c308
-rw-r--r--sql/src/main/native/sub.mk19
-rw-r--r--sqlite-jdbc/Android.mk23
-rw-r--r--sqlite-jdbc/MODULE_LICENSE_BSD_LIKE (renamed from sql/MODULE_LICENSE_BSD_LIKE)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Authorizer.java (renamed from sql/src/main/java/SQLite/Authorizer.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Blob.java (renamed from sql/src/main/java/SQLite/Blob.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/BusyHandler.java (renamed from sql/src/main/java/SQLite/BusyHandler.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Callback.java (renamed from sql/src/main/java/SQLite/Callback.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Constants.java (renamed from sql/src/main/java/SQLite/Constants.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Database.java (renamed from sql/src/main/java/SQLite/Database.java)46
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Exception.java (renamed from sql/src/main/java/SQLite/Exception.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Function.java (renamed from sql/src/main/java/SQLite/Function.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/FunctionContext.java (renamed from sql/src/main/java/SQLite/FunctionContext.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCConnection.java (renamed from sql/src/main/java/SQLite/JDBC2y/JDBCConnection.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCDatabaseMetaData.java (renamed from sql/src/main/java/SQLite/JDBC2y/JDBCDatabaseMetaData.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCPreparedStatement.java (renamed from sql/src/main/java/SQLite/JDBC2y/JDBCPreparedStatement.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCResultSet.java (renamed from sql/src/main/java/SQLite/JDBC2y/JDBCResultSet.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCResultSetMetaData.java (renamed from sql/src/main/java/SQLite/JDBC2y/JDBCResultSetMetaData.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCStatement.java (renamed from sql/src/main/java/SQLite/JDBC2y/JDBCStatement.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/JDBC2y/TableResultX.java (renamed from sql/src/main/java/SQLite/JDBC2y/TableResultX.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/JDBCDriver.java (renamed from sql/src/main/java/SQLite/JDBCDriver.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/ProgressHandler.java (renamed from sql/src/main/java/SQLite/ProgressHandler.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Shell.java (renamed from sql/src/main/java/SQLite/Shell.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Stmt.java (renamed from sql/src/main/java/SQLite/Stmt.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/StringEncoder.java (renamed from sql/src/main/java/SQLite/StringEncoder.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/TableResult.java (renamed from sql/src/main/java/SQLite/TableResult.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Trace.java (renamed from sql/src/main/java/SQLite/Trace.java)0
-rw-r--r--sqlite-jdbc/src/main/java/SQLite/Vm.java (renamed from sql/src/main/java/SQLite/Vm.java)0
-rw-r--r--sqlite-jdbc/src/main/native/sqlite_jni.c (renamed from sql/src/main/native/sqlite_jni.c)24
-rw-r--r--sqlite-jdbc/src/main/native/sqlite_jni.h (renamed from sql/src/main/native/sqlite_jni.h)0
-rw-r--r--sqlite-jdbc/src/main/native/sqlite_jni_defs.h (renamed from sql/src/main/native/sqlite_jni_defs.h)0
33 files changed, 95 insertions, 367 deletions
diff --git a/JavaLibrary.mk b/JavaLibrary.mk
index c9fe3e2..f9468a8 100644
--- a/JavaLibrary.mk
+++ b/JavaLibrary.mk
@@ -21,26 +21,36 @@
# Common definitions for host and target.
#
-# The core library is divided into modules. Each module has a separate
-# Java source directory, and some (hopefully eventually all) also have
-# a directory for tests.
+# dalvik/libcore is divided into modules.
+#
+# The structure of each module is:
+#
+# src/
+# main/ # To be shipped on every device.
+# java/ # Java source for library code.
+# native/ # C++ source for library code.
+# resources/ # Support files.
+# test/ # Built only on demand, for testing.
+# java/ # Java source for tests.
+# native/ # C++ source for tests (rare).
+# resources/ # Support files.
+#
+# All subdirectories are optional (hence the "2> /dev/null"s below).
-define all-core-java-files
-$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find */src/main/java -name "*.java"))
+define all-main-java-files-under
+$(foreach dir,$(1),$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(dir)/src/main/java -name "*.java" 2> /dev/null)))
endef
define all-test-java-files-under
-$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(1)/src/test/java -name "*.java"))
+$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(1)/src/test/java -name "*.java" 2> /dev/null))
endef
-# Redirect ls stderr to /dev/null because the corresponding resources
-# directories don't always exist.
define all-core-resource-dirs
$(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/{java,resources} 2> /dev/null)
endef
# The Java files and their associated resources.
-core_src_files := $(call all-core-java-files)
+core_src_files := $(call all-main-java-files-under,annotation archive auth awt-kernel concurrent crypto dalvik dom icu json junit logging luni luni-kernel math nio nio_char openssl prefs regex security security-kernel sql suncompat support text x-net xml)
core_resource_dirs := $(call all-core-resource-dirs,main)
test_resource_dirs := $(call all-core-resource-dirs,test)
@@ -70,6 +80,15 @@ core-intermediates := ${intermediates}
+# Definitions to make the sqlite JDBC driver.
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := $(call all-main-java-files-under,sqlite-jdbc)
+LOCAL_NO_STANDARD_LIBRARIES := true
+LOCAL_JAVA_LIBRARIES := core
+LOCAL_MODULE := sqlite-jdbc
+include $(BUILD_JAVA_LIBRARY)
+
# Definitions to make the core-tests libraries.
#
@@ -269,7 +288,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-test-java-files-under,sql)
LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := core core-tests-support
+LOCAL_JAVA_LIBRARIES := core core-tests-support sqlite-jdbc
LOCAL_DX_FLAGS := --core-library
LOCAL_MODULE_TAGS := tests
LOCAL_MODULE := core-tests-sql
diff --git a/run-core-tests b/run-core-tests
index 9c47f7c..171ee21 100755
--- a/run-core-tests
+++ b/run-core-tests
@@ -24,14 +24,13 @@ mkdir $tmp
chmod 777 $tmp
# Build the classpath by putting together the jar file for each module.
+classpath="/system/framework/sqlite-jdbc.jar" # Bonus item for jdbc testing.
modules="annotation archive concurrent crypto dom icu json \
logging luni-kernel luni math nio nio_char prefs regex security sql \
suncompat support text x-net xml"
-classpath=""
for module in $modules; do
classpath="$classpath:/system/framework/core-tests-$module.jar"
done
-classpath=${classpath#:}
exec dalvikvm \
-Duser.name=root \
diff --git a/sql/src/main/native/sqlite_jni_registration.c b/sql/src/main/native/sqlite_jni_registration.c
deleted file mode 100644
index 1ef5192..0000000
--- a/sql/src/main/native/sqlite_jni_registration.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright 2007, The Android Open Source Project
- *
- * 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.
- */
-
-#include "JNIHelp.h"
-#include "sqlite_jni.h"
-
-/* Methods for class SQLite_Database */
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1open
- (JNIEnv *, jobject, jstring, jint);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1open_1aux_1file
- (JNIEnv *, jobject, jstring);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1finalize
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1close
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1exec__Ljava_lang_String_2LSQLite_Callback_2
- (JNIEnv *, jobject, jstring, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1exec__Ljava_lang_String_2LSQLite_Callback_2_3Ljava_lang_String_2
- (JNIEnv *, jobject, jstring, jobject, jobjectArray);
-extern JNIEXPORT jlong JNICALL Java_SQLite_Database__1last_1insert_1rowid
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1interrupt
- (JNIEnv *, jobject);
-extern JNIEXPORT jlong JNICALL Java_SQLite_Database__1changes
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1busy_1handler
- (JNIEnv *, jobject, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1busy_1timeout
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jboolean JNICALL Java_SQLite_Database__1complete
- (JNIEnv *, jclass, jstring);
-extern JNIEXPORT jstring JNICALL Java_SQLite_Database_version
- (JNIEnv *, jclass);
-extern JNIEXPORT jstring JNICALL Java_SQLite_Database_dbversion
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1create_1function
- (JNIEnv *, jobject, jstring, jint, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1create_1aggregate
- (JNIEnv *, jobject, jstring, jint, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1function_1type
- (JNIEnv *, jobject, jstring, jint);
-extern JNIEXPORT jstring JNICALL Java_SQLite_Database__1errmsg
- (JNIEnv *, jobject);
-extern JNIEXPORT jstring JNICALL Java_SQLite_Database_error_1string
- (JNIEnv *, jclass, jint);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1set_1encoding
- (JNIEnv *, jobject, jstring);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1set_1authorizer
- (JNIEnv *, jobject, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1trace
- (JNIEnv *, jobject, jobject);
-extern JNIEXPORT jboolean JNICALL Java_SQLite_Database_is3
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database_vm_1compile
- (JNIEnv *, jobject, jstring, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database_vm_1compile_1args
- (JNIEnv *, jobject, jstring, jobject, jobjectArray);
-extern JNIEXPORT void JNICALL Java_SQLite_Database_stmt_1prepare
- (JNIEnv *, jobject, jstring, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1open_1blob
- (JNIEnv *, jobject, jstring, jstring, jstring, jlong, jboolean, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database__1progress_1handler
- (JNIEnv *, jobject, jint, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Database_internal_1init
- (JNIEnv *, jclass);
-
-
-/* Methods for class SQLite_Vm */
-
-extern JNIEXPORT jboolean JNICALL Java_SQLite_Vm_step
- (JNIEnv *, jobject, jobject);
-extern JNIEXPORT jboolean JNICALL Java_SQLite_Vm_compile
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Vm_stop
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Vm_finalize
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Vm_internal_1init
- (JNIEnv *, jclass);
-
-/* Methods for class SQLite_FunctionContext */
-
-extern JNIEXPORT void JNICALL Java_SQLite_FunctionContext_set_1result__Ljava_lang_String_2
- (JNIEnv *, jobject, jstring);
-extern JNIEXPORT void JNICALL Java_SQLite_FunctionContext_set_1result__I
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT void JNICALL Java_SQLite_FunctionContext_set_1result__D
- (JNIEnv *, jobject, jdouble);
-extern JNIEXPORT void JNICALL Java_SQLite_FunctionContext_set_1error
- (JNIEnv *, jobject, jstring);
-extern JNIEXPORT void JNICALL Java_SQLite_FunctionContext_set_1result___3B
- (JNIEnv *, jobject, jbyteArray);
-extern JNIEXPORT void JNICALL Java_SQLite_FunctionContext_set_1result_1zeroblob
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jint JNICALL Java_SQLite_FunctionContext_count
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_FunctionContext_internal_1init
- (JNIEnv *, jclass);
-
-/* Methods for class SQLite_Stmt */
-
-extern JNIEXPORT jboolean JNICALL Java_SQLite_Stmt_prepare
- (JNIEnv *, jobject);
-extern JNIEXPORT jboolean JNICALL Java_SQLite_Stmt_step
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_close
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_reset
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_clear_1bindings
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_bind__II
- (JNIEnv *, jobject, jint, jint);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_bind__IJ
- (JNIEnv *, jobject, jint, jlong);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_bind__ID
- (JNIEnv *, jobject, jint, jdouble);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_bind__I_3B
- (JNIEnv *, jobject, jint, jbyteArray);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_bind__ILjava_lang_String_2
- (JNIEnv *, jobject, jint, jstring);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_bind__I
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_bind_1zeroblob
- (JNIEnv *, jobject, jint, jint);
-extern JNIEXPORT jint JNICALL Java_SQLite_Stmt_bind_1parameter_1count
- (JNIEnv *, jobject);
-extern JNIEXPORT jstring JNICALL Java_SQLite_Stmt_bind_1parameter_1name
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jint JNICALL Java_SQLite_Stmt_bind_1parameter_1index
- (JNIEnv *, jobject, jstring);
-extern JNIEXPORT jint JNICALL Java_SQLite_Stmt_column_1int
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jlong JNICALL Java_SQLite_Stmt_column_1long
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jdouble JNICALL Java_SQLite_Stmt_column_1double
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jbyteArray JNICALL Java_SQLite_Stmt_column_1bytes
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jstring JNICALL Java_SQLite_Stmt_column_1string
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jint JNICALL Java_SQLite_Stmt_column_1type
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jint JNICALL Java_SQLite_Stmt_column_1count
- (JNIEnv *, jobject);
-extern JNIEXPORT jstring JNICALL Java_SQLite_Stmt_column_1table_1name
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jstring JNICALL Java_SQLite_Stmt_column_1database_1name
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jstring JNICALL Java_SQLite_Stmt_column_1decltype
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT jstring JNICALL Java_SQLite_Stmt_column_1origin_1name
- (JNIEnv *, jobject, jint);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_finalize
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Stmt_internal_1init
- (JNIEnv *, jclass);
-
-/* Methods for class SQLite_Blob */
-
-extern JNIEXPORT void JNICALL Java_SQLite_Blob_close
- (JNIEnv *, jobject);
-extern JNIEXPORT jint JNICALL Java_SQLite_Blob_write
- (JNIEnv *, jobject, jbyteArray, jint, jint, jint);
-extern JNIEXPORT jint JNICALL Java_SQLite_Blob_read
- (JNIEnv *, jobject, jbyteArray, jint, jint, jint);
-extern JNIEXPORT void JNICALL Java_SQLite_Blob_finalize
- (JNIEnv *, jobject);
-extern JNIEXPORT void JNICALL Java_SQLite_Blob_internal_1init
- (JNIEnv *, jclass);
-
-/*
- * JNI registration
- */
-static JNINativeMethod sqliteDatabaseMethods[] = {
- /* name, signature, funcPtr */
-/* Header for class SQLite_Database */
-{ "_open", "(Ljava/lang/String;I)V", Java_SQLite_Database__1open},
-{ "_open_aux_file", "(Ljava/lang/String;)V", Java_SQLite_Database__1open_1aux_1file},
-{ "_finalize", "()V", Java_SQLite_Database__1finalize},
-{ "_close", "()V", Java_SQLite_Database__1close},
-{ "_exec", "(Ljava/lang/String;LSQLite/Callback;)V", Java_SQLite_Database__1exec__Ljava_lang_String_2LSQLite_Callback_2},
-{ "_exec", "(Ljava/lang/String;LSQLite/Callback;[Ljava/lang/String;)V", Java_SQLite_Database__1exec__Ljava_lang_String_2LSQLite_Callback_2_3Ljava_lang_String_2},
-{ "_last_insert_rowid", "()J", Java_SQLite_Database__1last_1insert_1rowid},
-{ "_interrupt", "()V", Java_SQLite_Database__1interrupt},
-{ "_changes", "()J", Java_SQLite_Database__1changes},
-{ "_busy_handler", "(LSQLite/BusyHandler;)V", Java_SQLite_Database__1busy_1handler},
-{ "_busy_timeout", "(I)V", Java_SQLite_Database__1busy_1timeout},
-{ "_complete", "(Ljava/lang/String;)Z", Java_SQLite_Database__1complete},
-{ "version", "()Ljava/lang/String;", Java_SQLite_Database_version},
-{ "dbversion", "()Ljava/lang/String;", Java_SQLite_Database_dbversion},
-{ "_create_function", "(Ljava/lang/String;ILSQLite/Function;)V", Java_SQLite_Database__1create_1function},
-{ "_create_aggregate", "(Ljava/lang/String;ILSQLite/Function;)V", Java_SQLite_Database__1create_1aggregate},
-{ "_function_type", "(Ljava/lang/String;I)V", Java_SQLite_Database__1function_1type},
-{ "_errmsg", "()Ljava/lang/String;", Java_SQLite_Database__1errmsg},
-{ "error_string", "(I)Ljava/lang/String;", Java_SQLite_Database_error_1string},
-{ "_set_encoding", "(Ljava/lang/String;)V", Java_SQLite_Database__1set_1encoding},
-{ "_set_authorizer", "(LSQLite/Authorizer;)V", Java_SQLite_Database__1set_1authorizer},
-{ "_trace", "(LSQLite/Trace;)V", Java_SQLite_Database__1trace},
-{ "is3", "()Z", Java_SQLite_Database_is3},
-{ "vm_compile", "(Ljava/lang/String;LSQLite/Vm;)V", Java_SQLite_Database_vm_1compile},
-{ "vm_compile_args", "(Ljava/lang/String;LSQLite/Vm;[Ljava/lang/String;)V", Java_SQLite_Database_vm_1compile_1args},
-{ "stmt_prepare", "(Ljava/lang/String;LSQLite/Stmt;)V", Java_SQLite_Database_stmt_1prepare},
-{ "_open_blob", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JZLSQLite/Blob;)V", Java_SQLite_Database__1open_1blob},
-{ "_progress_handler", "(ILSQLite/ProgressHandler;)V", Java_SQLite_Database__1progress_1handler},
-{ "internal_init", "()V", Java_SQLite_Database_internal_1init}
-};
-
-static JNINativeMethod sqliteVmMethods[] = {
-/* Header for class SQLite_Vm */
-{ "step", "(LSQLite/Callback;)Z", Java_SQLite_Vm_step},
-{ "compile", "()Z", Java_SQLite_Vm_compile},
-{ "stop", "()V", Java_SQLite_Vm_stop},
-{ "finalize", "()V", Java_SQLite_Vm_finalize},
-{ "internal_init", "()V", Java_SQLite_Vm_internal_1init}
-};
-
-static JNINativeMethod sqliteFunctionContextMethods[] = {
-/* Header for class SQLite_FunctionContext */
-{ "set_result", "(Ljava/lang/String;)V", Java_SQLite_FunctionContext_set_1result__Ljava_lang_String_2},
-{ "set_result", "(I)V", Java_SQLite_FunctionContext_set_1result__I},
-{ "set_result", "(D)V", Java_SQLite_FunctionContext_set_1result__D},
-{ "set_error", "(Ljava/lang/String;)V", Java_SQLite_FunctionContext_set_1error},
-{ "set_result", "([B)V", Java_SQLite_FunctionContext_set_1result___3B},
-{ "set_result_zeroblob", "(I)V", Java_SQLite_FunctionContext_set_1result_1zeroblob},
-{ "count", "()I", Java_SQLite_FunctionContext_count},
-{ "internal_init", "()V", Java_SQLite_FunctionContext_internal_1init}
-};
-
-static JNINativeMethod sqliteStmtMethods[] = {
-/* Header for class SQLite_Stmt */
-{ "prepare", "()Z", Java_SQLite_Stmt_prepare},
-{ "step", "()Z", JNICALL Java_SQLite_Stmt_step},
-{ "close", "()V", Java_SQLite_Stmt_close},
-{ "reset", "()V", Java_SQLite_Stmt_reset},
-{ "clear_bindings", "()V", Java_SQLite_Stmt_clear_1bindings},
-{ "bind", "(II)V", Java_SQLite_Stmt_bind__II},
-{ "bind", "(IJ)V", Java_SQLite_Stmt_bind__IJ},
-{ "bind", "(ID)V", Java_SQLite_Stmt_bind__ID},
-{ "bind", "(I[B)V", Java_SQLite_Stmt_bind__I_3B},
-{ "bind", "(ILjava/lang/String;)V", Java_SQLite_Stmt_bind__ILjava_lang_String_2},
-{ "bind", "(I)V", Java_SQLite_Stmt_bind__I},
-{ "bind_zeroblob", "(II)V", Java_SQLite_Stmt_bind_1zeroblob},
-{ "bind_parameter_count", "()I", Java_SQLite_Stmt_bind_1parameter_1count},
-{ "bind_parameter_name", "(I)Ljava/lang/String;", Java_SQLite_Stmt_bind_1parameter_1name},
-{ "bind_parameter_index", "(Ljava/lang/String;)I", Java_SQLite_Stmt_bind_1parameter_1index},
-{ "column_int", "(I)I", Java_SQLite_Stmt_column_1int},
-{ "column_long", "(I)J", Java_SQLite_Stmt_column_1long},
-{ "column_double", "(I)D", Java_SQLite_Stmt_column_1double},
-{ "column_bytes", "(I)[B", Java_SQLite_Stmt_column_1bytes},
-{ "column_string", "(I)Ljava/lang/String;", Java_SQLite_Stmt_column_1string},
-{ "column_type", "(I)I", Java_SQLite_Stmt_column_1type},
-{ "column_count", "()I", Java_SQLite_Stmt_column_1count},
-{ "column_table_name", "(I)Ljava/lang/String;", Java_SQLite_Stmt_column_1table_1name},
-{ "column_database_name", "(I)Ljava/lang/String;", Java_SQLite_Stmt_column_1database_1name},
-{ "column_decltype", "(I)Ljava/lang/String;", Java_SQLite_Stmt_column_1decltype},
-{ "column_origin_name", "(I)Ljava/lang/String;", Java_SQLite_Stmt_column_1origin_1name},
-{ "finalize", "()V", Java_SQLite_Stmt_finalize},
-{ "internal_init", "()V", Java_SQLite_Stmt_internal_1init}
-};
-
-static JNINativeMethod sqliteBlobMethods[] = {
-/* Header for class SQLite_Blob */
-
-{ "close", "()V", Java_SQLite_Blob_close},
-{ "write", "([BIII)I", Java_SQLite_Blob_write},
-{ "read", "([BIII)I", Java_SQLite_Blob_read},
-{ "finalize", "()V", Java_SQLite_Blob_finalize},
-{ "internal_init", "()V", Java_SQLite_Blob_internal_1init}
-};
-
-int register_SQLite_Database(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "SQLite/Database",
- sqliteDatabaseMethods, NELEM(sqliteDatabaseMethods));
-}
-
-int register_SQLite_Vm(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "SQLite/Vm",
- sqliteVmMethods, NELEM(sqliteVmMethods));
-}
-
-int register_SQLite_FunctionContext(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "SQLite/FunctionContext",
- sqliteFunctionContextMethods, NELEM(sqliteFunctionContextMethods));
-}
-
-int register_SQLite_Stmt(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "SQLite/Stmt",
- sqliteStmtMethods, NELEM(sqliteStmtMethods));
-}
-
-int register_SQLite_Blob(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "SQLite/Blob",
- sqliteBlobMethods, NELEM(sqliteBlobMethods));
-}
diff --git a/sql/src/main/native/sub.mk b/sql/src/main/native/sub.mk
deleted file mode 100644
index d84e0b6..0000000
--- a/sql/src/main/native/sub.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-# This file is included by the top-level libcore Android.mk.
-# It's not a normal makefile, so we don't include CLEAR_VARS
-# or BUILD_*_LIBRARY.
-
-LOCAL_SRC_FILES := \
- sqlite_jni.c \
- sqlite_jni_registration.c
-
-LOCAL_C_INCLUDES += \
- external/sqlite/dist
-
-# Any shared/static libs that are listed here must also
-# be listed in libs/nativehelper/Android.mk.
-# TODO: fix this requirement
-
-LOCAL_SHARED_LIBRARIES += \
- libsqlite
-
-LOCAL_STATIC_LIBRARIES +=
diff --git a/sqlite-jdbc/Android.mk b/sqlite-jdbc/Android.mk
new file mode 100644
index 0000000..2c3926a
--- /dev/null
+++ b/sqlite-jdbc/Android.mk
@@ -0,0 +1,23 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ src/main/native/sqlite_jni.c
+
+LOCAL_C_INCLUDES += \
+ $(JNI_H_INCLUDE) \
+ external/sqlite/dist
+
+LOCAL_SHARED_LIBRARIES += \
+ libsqlite
+
+LOCAL_STATIC_LIBRARIES +=
+
+# This name is dictated by the fact that the SQLite code calls
+# loadLibrary("sqlite_jni").
+LOCAL_MODULE := libsqlite_jni
+
+TARGET_PRELINK_MODULE := false
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/sql/MODULE_LICENSE_BSD_LIKE b/sqlite-jdbc/MODULE_LICENSE_BSD_LIKE
index e69de29..e69de29 100644
--- a/sql/MODULE_LICENSE_BSD_LIKE
+++ b/sqlite-jdbc/MODULE_LICENSE_BSD_LIKE
diff --git a/sql/src/main/java/SQLite/Authorizer.java b/sqlite-jdbc/src/main/java/SQLite/Authorizer.java
index cdc321d..cdc321d 100644
--- a/sql/src/main/java/SQLite/Authorizer.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Authorizer.java
diff --git a/sql/src/main/java/SQLite/Blob.java b/sqlite-jdbc/src/main/java/SQLite/Blob.java
index 3de9f8a..3de9f8a 100644
--- a/sql/src/main/java/SQLite/Blob.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Blob.java
diff --git a/sql/src/main/java/SQLite/BusyHandler.java b/sqlite-jdbc/src/main/java/SQLite/BusyHandler.java
index c39b39d..c39b39d 100644
--- a/sql/src/main/java/SQLite/BusyHandler.java
+++ b/sqlite-jdbc/src/main/java/SQLite/BusyHandler.java
diff --git a/sql/src/main/java/SQLite/Callback.java b/sqlite-jdbc/src/main/java/SQLite/Callback.java
index 3eeb605..3eeb605 100644
--- a/sql/src/main/java/SQLite/Callback.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Callback.java
diff --git a/sql/src/main/java/SQLite/Constants.java b/sqlite-jdbc/src/main/java/SQLite/Constants.java
index 4e636b9..4e636b9 100644
--- a/sql/src/main/java/SQLite/Constants.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Constants.java
diff --git a/sql/src/main/java/SQLite/Database.java b/sqlite-jdbc/src/main/java/SQLite/Database.java
index dcaaf9d..fbb5d29 100644
--- a/sql/src/main/java/SQLite/Database.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Database.java
@@ -587,29 +587,29 @@ public class Database {
*/
static {
- try {
-// String path = System.getProperty("SQLite.library.path");
-// if (path == null || path.length() == 0){
-// System.loadLibrary("sqlite_jni");
-// } else {
-// try {
-// java.lang.reflect.Method mapLibraryName;
-// Class param[] = new Class[1];
-// param[0] = String.class;
-// mapLibraryName = System.class.getMethod("mapLibraryName",
-// param);
-// Object args[] = new Object[1];
-// args[0] = "sqlite_jni";
-// String mapped = (String) mapLibraryName.invoke(null, args);
-// System.load(path + java.io.File.separator + mapped);
-// } catch (Throwable t) {
-// System.loadLibrary("sqlite_jni");
-// }
-// }
- internal_init();
- } catch (Throwable t) {
- System.err.println("Unable to load sqlite: " + t);
- }
+ try {
+ String path = System.getProperty("SQLite.library.path");
+ if (path == null || path.length() == 0){
+ System.loadLibrary("sqlite_jni");
+ } else {
+ try {
+ java.lang.reflect.Method mapLibraryName;
+ Class param[] = new Class[1];
+ param[0] = String.class;
+ mapLibraryName = System.class.getMethod("mapLibraryName",
+ param);
+ Object args[] = new Object[1];
+ args[0] = "sqlite_jni";
+ String mapped = (String) mapLibraryName.invoke(null, args);
+ System.load(path + java.io.File.separator + mapped);
+ } catch (Throwable t) {
+ System.loadLibrary("sqlite_jni");
+ }
+ }
+ internal_init();
+ } catch (Throwable t) {
+ System.err.println("Unable to load sqlite: " + t);
+ }
}
}
diff --git a/sql/src/main/java/SQLite/Exception.java b/sqlite-jdbc/src/main/java/SQLite/Exception.java
index cc26b99..cc26b99 100644
--- a/sql/src/main/java/SQLite/Exception.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Exception.java
diff --git a/sql/src/main/java/SQLite/Function.java b/sqlite-jdbc/src/main/java/SQLite/Function.java
index 5aa5e33..5aa5e33 100644
--- a/sql/src/main/java/SQLite/Function.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Function.java
diff --git a/sql/src/main/java/SQLite/FunctionContext.java b/sqlite-jdbc/src/main/java/SQLite/FunctionContext.java
index d0b5182..d0b5182 100644
--- a/sql/src/main/java/SQLite/FunctionContext.java
+++ b/sqlite-jdbc/src/main/java/SQLite/FunctionContext.java
diff --git a/sql/src/main/java/SQLite/JDBC2y/JDBCConnection.java b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCConnection.java
index 20c98e3..20c98e3 100644
--- a/sql/src/main/java/SQLite/JDBC2y/JDBCConnection.java
+++ b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCConnection.java
diff --git a/sql/src/main/java/SQLite/JDBC2y/JDBCDatabaseMetaData.java b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCDatabaseMetaData.java
index 8c14d1d..8c14d1d 100644
--- a/sql/src/main/java/SQLite/JDBC2y/JDBCDatabaseMetaData.java
+++ b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCDatabaseMetaData.java
diff --git a/sql/src/main/java/SQLite/JDBC2y/JDBCPreparedStatement.java b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCPreparedStatement.java
index ab81867..ab81867 100644
--- a/sql/src/main/java/SQLite/JDBC2y/JDBCPreparedStatement.java
+++ b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCPreparedStatement.java
diff --git a/sql/src/main/java/SQLite/JDBC2y/JDBCResultSet.java b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCResultSet.java
index 06384eb..06384eb 100644
--- a/sql/src/main/java/SQLite/JDBC2y/JDBCResultSet.java
+++ b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCResultSet.java
diff --git a/sql/src/main/java/SQLite/JDBC2y/JDBCResultSetMetaData.java b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCResultSetMetaData.java
index 934ca78..934ca78 100644
--- a/sql/src/main/java/SQLite/JDBC2y/JDBCResultSetMetaData.java
+++ b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCResultSetMetaData.java
diff --git a/sql/src/main/java/SQLite/JDBC2y/JDBCStatement.java b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCStatement.java
index 99d12d3..99d12d3 100644
--- a/sql/src/main/java/SQLite/JDBC2y/JDBCStatement.java
+++ b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/JDBCStatement.java
diff --git a/sql/src/main/java/SQLite/JDBC2y/TableResultX.java b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/TableResultX.java
index 205372f..205372f 100644
--- a/sql/src/main/java/SQLite/JDBC2y/TableResultX.java
+++ b/sqlite-jdbc/src/main/java/SQLite/JDBC2y/TableResultX.java
diff --git a/sql/src/main/java/SQLite/JDBCDriver.java b/sqlite-jdbc/src/main/java/SQLite/JDBCDriver.java
index 63b95ee..63b95ee 100644
--- a/sql/src/main/java/SQLite/JDBCDriver.java
+++ b/sqlite-jdbc/src/main/java/SQLite/JDBCDriver.java
diff --git a/sql/src/main/java/SQLite/ProgressHandler.java b/sqlite-jdbc/src/main/java/SQLite/ProgressHandler.java
index b2ec7c0..b2ec7c0 100644
--- a/sql/src/main/java/SQLite/ProgressHandler.java
+++ b/sqlite-jdbc/src/main/java/SQLite/ProgressHandler.java
diff --git a/sql/src/main/java/SQLite/Shell.java b/sqlite-jdbc/src/main/java/SQLite/Shell.java
index 78d37a1..78d37a1 100644
--- a/sql/src/main/java/SQLite/Shell.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Shell.java
diff --git a/sql/src/main/java/SQLite/Stmt.java b/sqlite-jdbc/src/main/java/SQLite/Stmt.java
index c4f72ed..c4f72ed 100644
--- a/sql/src/main/java/SQLite/Stmt.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Stmt.java
diff --git a/sql/src/main/java/SQLite/StringEncoder.java b/sqlite-jdbc/src/main/java/SQLite/StringEncoder.java
index c2f20ad..c2f20ad 100644
--- a/sql/src/main/java/SQLite/StringEncoder.java
+++ b/sqlite-jdbc/src/main/java/SQLite/StringEncoder.java
diff --git a/sql/src/main/java/SQLite/TableResult.java b/sqlite-jdbc/src/main/java/SQLite/TableResult.java
index 1a7fb57..1a7fb57 100644
--- a/sql/src/main/java/SQLite/TableResult.java
+++ b/sqlite-jdbc/src/main/java/SQLite/TableResult.java
diff --git a/sql/src/main/java/SQLite/Trace.java b/sqlite-jdbc/src/main/java/SQLite/Trace.java
index 19ed2a1..19ed2a1 100644
--- a/sql/src/main/java/SQLite/Trace.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Trace.java
diff --git a/sql/src/main/java/SQLite/Vm.java b/sqlite-jdbc/src/main/java/SQLite/Vm.java
index 9856ed0..9856ed0 100644
--- a/sql/src/main/java/SQLite/Vm.java
+++ b/sqlite-jdbc/src/main/java/SQLite/Vm.java
diff --git a/sql/src/main/native/sqlite_jni.c b/sqlite-jdbc/src/main/native/sqlite_jni.c
index 341ef2e..1333d24 100644
--- a/sql/src/main/native/sqlite_jni.c
+++ b/sqlite-jdbc/src/main/native/sqlite_jni.c
@@ -1,11 +1,10 @@
#include "JNIHelp.h"
+#include "sqlite_jni_defs.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include "sqlite_jni_defs.h"
-
#if HAVE_SQLITE2
#include "sqlite.h"
#endif
@@ -278,13 +277,23 @@ freep(char **strp)
static void
throwex(JNIEnv *env, const char *msg)
{
- jniThrowException(env, "SQLite/Exception", msg);
+ jclass except = (*env)->FindClass(env, "SQLite/Exception");
+
+ (*env)->ExceptionClear(env);
+ if (except) {
+ (*env)->ThrowNew(env, except, msg);
+ }
}
static void
throwoom(JNIEnv *env, const char *msg)
{
- jniThrowException(env, "java/lang/OutOfMemoryError", msg);
+ jclass except = (*env)->FindClass(env, "java/lang/OutOfMemoryError");
+
+ (*env)->ExceptionClear(env);
+ if (except) {
+ (*env)->ThrowNew(env, except, msg);
+ }
}
static void
@@ -297,7 +306,12 @@ throwclosed(JNIEnv *env)
static void
throwioex(JNIEnv *env, const char *msg)
{
- jniThrowException(env, "java/io/IOException", msg);
+ jclass except = (*env)->FindClass(env, "java/io/IOException");
+
+ (*env)->ExceptionClear(env);
+ if (except) {
+ (*env)->ThrowNew(env, except, msg);
+ }
}
#endif
diff --git a/sql/src/main/native/sqlite_jni.h b/sqlite-jdbc/src/main/native/sqlite_jni.h
index cdb7692..cdb7692 100644
--- a/sql/src/main/native/sqlite_jni.h
+++ b/sqlite-jdbc/src/main/native/sqlite_jni.h
diff --git a/sql/src/main/native/sqlite_jni_defs.h b/sqlite-jdbc/src/main/native/sqlite_jni_defs.h
index 91b2378..91b2378 100644
--- a/sql/src/main/native/sqlite_jni_defs.h
+++ b/sqlite-jdbc/src/main/native/sqlite_jni_defs.h