Questions tagged as 'sqlite'

1
answer

Syntax error when using SQLite android "DROP TABLE IF EXISTS"

packagecom.example.wesley.bancodedadossqlite;importandroid.database.sqlite.SQLiteDatabase;importandroid.database.sqlite.SQLiteOpenHelper;/***CreatedbyWesleyon17/01/2018.*/publicclassCriaBancoextendsSQLiteOpenHelper{privatestaticfinalStringNOME_...
asked by 17.01.2018 / 23:35
1
answer

SQLite error: foreign key mismatch (fk incompativeis) when trying to do an INSERT

I'm trying to create a Associative Entity (N: N) in SQLite like this:    [Pet --- < VaccinePet> Vaccine] And, here is my Associative Entity code CREATE TABLE VACINAPET ( vp_data TEXT NOT NULL, vp_is_aplicada INTEGE...
asked by 18.01.2018 / 00:48
1
answer

App database does not delete

I have a problem. I created an app and it uses sqlite local bank, the problem is the following, even I cleaning the data and uninstalling the app, when I install it again, it retrieves the old data that was in the database. Someone can help...
asked by 10.10.2017 / 17:00
2
answers

How to list the last message of all conversations

I'm creating a chat in android studio, so I need to list the last message between the chat user and his contacts, regardless of whether he sent or received the last message. I made the select below in mysql and it works, but in sqli...
asked by 26.09.2017 / 01:59
1
answer

Attempt to invoke virtual method 'long ContactID.change (Contact)' on a null object reference [closed]

Error: 09-12 14:05:28.662 10410-10410/costamilam.guilherme.contatosempresariais E/AndroidRuntime: FATAL EXCEPTION: main Process: costamilam.guilherme.contatosempresariais, PID: 10410 java.lang.NullPointerException: Attempt to invoke virtual me...
asked by 12.09.2017 / 19:21
1
answer

How to delete not only tables but a database in SQLite

I would like to delete not only a table but the whole database in SQLite. Searching, I was told of a Context.deleteDatabase() method, but I can not use it, if I try to call a method, it says it is not static to be used in a static class,...
asked by 31.08.2017 / 01:28
3
answers

Loading an externally created SQLite database

I need to use a previously created Sqlite database, already with records inserted into it. But the only way I had done so far was when the application itself created the bank, which I myself populated internally in the application. Now I have...
asked by 05.09.2017 / 13:27
1
answer

Add SQLITE data in Java

Personal I have a problem that I can not solve in Java. The intention is to make the connection in a SQLite database. But I can not do the insertion. Take a look at the code, please. package conexao; import java.sql.Connection; import...
asked by 28.07.2017 / 21:08
1
answer

SQLite duplicate registration

I was able to avoid duplicate registration of romaneio(nr_roman) , but I made several attempts to do the same with plaqueta(plaq) , so that if the nameplate already exists in the database, it persists in the nr request % of the plat...
asked by 16.07.2017 / 16:58
1
answer

How to generate an insert string from json [closed]

I'm new and javascript and I need to generate an insert string for sqlite with this string: { "InputFile" : "PER_02.inp", "RunTime" : 1492167103, "Reservoir" : "5", "Elevation" : 400.000000, "UpStreamId" : "172", "UpStreamP" : 95.000000, "PRU_l...
asked by 12.09.2017 / 04:56