Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can't build berkeleyDB jdbc driver for android

user8199959Oct 5 2017 — edited Oct 5 2017

I'm developing an android app that needs to use big databased but it needs to run on the Android device.

I've found this database and tried to follow those instructions:

http://docs.oracle.com/cd/E17076_02/html/installation/build_android_jdbc.html

1) Downloaded db-6.2.32

2) ran the configure --enable-jdbc && make without problems

Now i'm trying to run step 4.:

$ < ndk-install-directory >/ndk-build

This gives me this error:

Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-14. /home/mariano/Android/android-ndk-r15b/build/core/build-binary.mk:688: 
Android NDK: Module db_archive depends on undefined modules: dl log icuuc icui18n utils /home/mariano/Android/android-ndk-r15b/build/core/build-binary.mk:701:
*** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.

After that, edited Android.mk and added the following line:

APP_ALLOW_MISSING_DEPS=true

This make the process to start but at the end, I have several errors that I don't know how to fix:

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:162:34: error: unrecognized instruction mnemonic

                    if (MUTEXP_IS_BUSY(mutexp) || !MUTEXP_ACQUIRE(mutexp)) {

                                                   ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:1099:2: note: expanded from macro 'MUTEXP_ACQUIRE'

            MUTEX_SET(&(mutexp)->tas))

            ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:477:3: note: expanded from macro 'MUTEX_SET'

                    "ldrex          %0, [%2]\n\t"                           \

                    ^

    <inline asm>:1:2: note: instantiated into assembly here

            ldrex           x8, [x28]

            ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:162:34: error: unrecognized instruction mnemonic

                    if (MUTEXP_IS_BUSY(mutexp) || !MUTEXP_ACQUIRE(mutexp)) {

                                                   ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:1099:2: note: expanded from macro 'MUTEXP_ACQUIRE'

            MUTEX_SET(&(mutexp)->tas))

            ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:478:17: note: expanded from macro 'MUTEX_SET'

                    "cmp            %0, %1\n\t"                             \

                                            ^

    <inline asm>:3:2: note: instantiated into assembly here

            strexne x8, x20, [x28]

            ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:162:34: error: unrecognized instruction mnemonic

                    if (MUTEXP_IS_BUSY(mutexp) || !MUTEXP_ACQUIRE(mutexp)) {

                                                   ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:1099:2: note: expanded from macro 'MUTEXP_ACQUIRE'

            MUTEX_SET(&(mutexp)->tas))

            ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:477:3: note: expanded from macro 'MUTEX_SET'

                    "ldrex          %0, [%2]\n\t"                           \

                    ^

    <inline asm>:1:2: note: instantiated into assembly here

            ldrex           x8, [x28]

            ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:162:34: error: unrecognized instruction mnemonic

                    if (MUTEXP_IS_BUSY(mutexp) || !MUTEXP_ACQUIRE(mutexp)) {

                                                   ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:1099:2: note: expanded from macro 'MUTEXP_ACQUIRE'

            MUTEX_SET(&(mutexp)->tas))

            ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:478:17: note: expanded from macro 'MUTEX_SET'

                    "cmp            %0, %1\n\t"                             \

                                            ^

    <inline asm>:3:2: note: instantiated into assembly here

            strexne x8, x22, [x28]

            ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:213:3: error: too few operands for instruction

                    MEMBAR_ENTER();

                    ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:492:23: note: expanded from macro 'MEMBAR_ENTER'

            ({ __asm__ volatile ("dsb"); })

                                 ^

    <inline asm>:1:2: note: instantiated into assembly here

            dsb

            ^~~

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:439:3: error: too few operands for instruction

                    MEMBAR_ENTER();

                    ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:492:23: note: expanded from macro 'MEMBAR_ENTER'

            ({ __asm__ volatile ("dsb"); })

                                 ^

    <inline asm>:1:2: note: instantiated into assembly here

            dsb

            ^~~

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:623:4: error: too few operands for instruction

                            MEMBAR_EXIT();

                            ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:494:23: note: expanded from macro 'MEMBAR_EXIT'

            ({ __asm__ volatile ("dsb"); })

                                 ^

    <inline asm>:1:2: note: instantiated into assembly here

            dsb

            ^~~

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:635:3: error: too few operands for instruction

                    MEMBAR_EXIT();

                    ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:494:23: note: expanded from macro 'MEMBAR_EXIT'

            ({ __asm__ volatile ("dsb"); })

                                 ^

    <inline asm>:1:2: note: instantiated into assembly here

            dsb

            ^~~

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:619:4: error: too few operands for instruction

                            MEMBAR_EXIT();

                            ^

    /home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:494:23: note: expanded from macro 'MEMBAR_EXIT'

            ({ __asm__ volatile ("dsb"); })

                                 ^

    <inline asm>:1:2: note: instantiated into assembly here

            dsb

            ^~~

    7 warnings and 9 errors generated.

I'm running linux mint,

Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit

Comments

21205
show it
SQL> declare
  2     ignore_column_name varchar2 (100) := 'ENAME';
  3     CURSOR C1 is
  4     SELECT column_name
  5     FROM user_tab_columns
  6     WHERE table_name = 'EMP'
  7  --   AND column_name NOT IN (ignore_column_name)
  8  ;
  9  begin
 10     for r in c1
 11     loop
 12        dbms_output.put_line ('result: '||r.column_name);
 13     end loop;
 14  end;
 15  /
result: EMPNO
result: ENAME
result: JOB
result: MGR
result: HIREDATE
result: SAL
result: COMM
result: DEPTNO

PL/SQL procedure successfully completed.

SQL> 
SQL> 
SQL> declare
  2     ignore_column_name varchar2 (100) := 'ENAME';
  3     CURSOR C1 is
  4     SELECT column_name
  5     FROM user_tab_columns
  6     WHERE table_name = 'EMP'
  7     AND column_name NOT IN (ignore_column_name)
  8  ;
  9  begin
 10     for r in c1
 11     loop
 12        dbms_output.put_line ('result: '||r.column_name);
 13     end loop;
 14  end;
 15  /
result: EMPNO
result: JOB
result: MGR
result: HIREDATE
result: SAL
result: COMM
result: DEPTNO

PL/SQL procedure successfully completed.

SQL> 
646894
Hello,

the only difference between your program and mine is that..

ignore_column_name variable is declared but not initialized before the cursor. I mean..

declare
ignore_columns_name varchar2(100);
cursor c1 is
select column_name
from user_tab_columns
where column_name not in (ignore_column_name);
begin
ignore_column_name := 'LNAME';
for r in c1
loop
column := column||','||r.column_name;
end loop;
##REST OF THE CODE##
end;
/

the thing is .. ignore_column_name is not hardcoded, instead it is generated from a different part of the code. so I cannot initialise it like u have shown it. Can u help me? is it possible to achieve this?

Thanks
BluShadow
Azeroth wrote:
Hello,

the only difference between your program and mine is that..

ignore_column_name variable is declared but not initialized before the cursor. I mean..

the thing is .. ignore_column_name is not hardcoded, instead it is generated from a different part of the code. so I cannot initialise it like u have shown it. Can u help me? is it possible to achieve this?

Thanks
It doesn't make a difference if it's initialized before the cursor declaration or not, just as long as it's initialized before the cursor is opened.
SQL> declare
  2    ignore_column_name varchar2 (100);
  3    CURSOR C1 is
  4    SELECT column_name
  5    FROM user_tab_columns
  6    WHERE table_name = 'EMP'
  7    AND column_name NOT IN (ignore_column_name);
  8  begin
  9    ignore_column_name := 'ENAME';
 10    for r in c1
 11    loop
 12       dbms_output.put_line ('result: '||r.column_name);
 13    end loop;
 14  end;
 15  /
result: EMPNO
result: JOB
result: MGR
result: HIREDATE
result: SAL
result: COMM
result: DEPTNO

PL/SQL procedure successfully completed.

SQL>
646894
Hello,

This was a really helpful reply.. it cleared my only suspicion but not my problem. Here I am pasting the entire code.. I will highlight the part thats not working.. Please let me know what you think the problem is.

CREATE OR REPLACE PROCEDURE
test_etl1
(
table1 IN user_tab_columns.table_name%TYPE,
table2 IN user_tab_columns.table_name%TYPE
) IS
col_list VARCHAR2(3000);
new_col_list VARCHAR2(3000);
column_name VARCHAR2(100);
num number;
table3 VARCHAR2(100);
column_list VARCHAR2(3000);
stmt VARCHAR2(3000);
CURSOR C1 IS
SELECT column_list
FROM ignore_columns
WHERE table_name = table1;
CURSOR C2 IS
SELECT column_name
FROM user_tab_columns
WHERE table_name = table3
AND column_name NOT IN (new_col_list);
BEGIN
col_list := null;
FOR R1 in C1
LOOP
col_list := R1.column_list;
END LOOP;
num := length(col_list);

WHILE num <> 1
LOOP
column_name := SUBSTR(col_list, 0,INSTR(col_list,' '));

IF (NVL(SUBSTR(col_list, INSTR(col_list, ' '), LENGTH(col_list)),'1') != '1')
THEN
col_list := SUBSTR(col_list, INSTR(col_list, ' '), LENGTH(col_list));
col_list := LTRIM(col_list);
new_col_list := new_col_list||''''||RTRIM(column_name)||''''||',';
ELSE
num := 1;
END IF;
END LOOP;

new_col_list := RTRIM(new_col_list,',');

table3 := upper(table1);
FOR R2 IN C2
LOOP
* column_list := column_list||''''||R2.column_name||''''||',';*
END LOOP;
column_list := RTRIM(column_list,',');
stmt := 'CREATE TABLE error_table AS SELECT '||column_list||' FROM '||table1||' MINUS SELECT '||column_list||'FROM '||table2;

END;

Table ignore_columns contains a single row.
table_name = patient_v
column_list = 'LAST_NAME'; with the quotes

Thanks
1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 2 2017
Added on Oct 5 2017
0 comments
703 views