java - Table is not created after running the query -
I have a problem to create the table, what is happening is the following, I have an XML file Questions need to be implemented when changing the version. The problem is that it reaches the height of the process of performing the query, but the database is not changed, the odd thing is that my XML file has two separate questions, the first run, but the second and the second It does not point to any bank error, my script is correct and it is returning all the questions, but it happens and I do not know why merge down Responsible for executing the query XML My task:
private boolean execSqlByQuery (catalog & lt; String [] & gt; listaQuery, SQLiteDatabase db) {boolean result = false; If (! ListaQuery.isEmpty ()) {try (for ii = 0; i & lt; listaQuery.size (); i ++) {for (int j = 0; j & lt; listaQuery.get (i) Length; J ++) {db.beginTransaction (); Log D. ("SQL", listEnclaimate.IT (I) [J] .oststring ()); Db.execSQL (listaQuery.get (i) [j] .toString ()); Db.setTransactionSuccessful (); Db.endTransaction (); }} Result = true; } Hold (exception before) {result = false; } Finally {listaQuery.clear (); }} Return result; }
Change your code like this:
Personal Boolean execSqlByQuery (list & lt; string [] & gt; listaQuery, SQLiteDatabase db) {Boolean result = false; If (! ListaQuery.isEmpty ()) {db.beginTransaction (); {For (int i = 0; i & lt; listaQuery.size (); i ++} {Try for (for int j = 0; j & lt; listaQuery.get (i) .length; j ++ ) {Log D. ("SQL", ListaQuery.get (i) [j] .toString ()); db.execSQL (listaQuery.get (i) [j] .toString ());}} Db.setTransactionSuccessful ( ); Result = true;} catch (exception before) {result = false;} finally {if (db! = Null) {db.endTransaction ();} ListaQuery.clear ();}} return result;}
Comments
Post a Comment