mercredi 22 avril 2015

Why is my SQLite database operation "updateinformation2" not changing my "name" value?

I have made a database operation that should accept: new name, new email, old password and new password as arguments. It should then update the database with the new information, that has been entered by the user, but it doesn't work! I honestly do not know why, here is my code:

    public void updateInformation2(DatabaseOperations dop, String nname, String nemail, String npass, String opass) {
    SQLiteDatabase SQ = dop.getWritableDatabase();

    ContentValues cv = new ContentValues();
    cv.put(TableData.TableInfo.USER_NAME, nname);
    cv.put(TableData.TableInfo.USER_PASS,npass);
    cv.put(TableData.TableInfo.USER_EMAIL,nemail);

    String[] args = new String[]{opass};
    SQ.update(TableData.TableInfo.TABLE_NAME, cv, TableData.TableInfo.USER_PASS+" =?", args);

    SQ.close();
}

if anymore details are needed let me know in the comments and I will update the code.

Based on user comments I have updated the code, but the new function just makes my app crash, here is the code:

    public void  updateInformation3(DatabaseOperations dop, String nname,String nemail, String npass, String opass)
{
    SQLiteDatabase SQ = dop.getWritableDatabase();
    // Define the updated row content.
    ContentValues updatedValues = new ContentValues();
    // Assign values for each row.
    updatedValues.put("TableData.TableInfo.USER_NAME", nname);
    updatedValues.put("TableData.TableInfo.USER_PASS",npass);
    updatedValues.put("TableData.TableInfo.USER_EMAIL",nemail);

    String where="TableData.TableInfo.USER_PASS = ?";
    SQ.update(TableData.TableInfo.TABLE_NAME,updatedValues, where, new String[]{opass});
    SQ.close();
}

Here is the complete LogCat as requested, up until the point of the application crashing.

04-22 02:38:51.158    2001-2001/com.example.wolfe_000.final_final_zeno E/libprocessgroup﹕ failed to make and chown /acct/uid_10102: Read-only file system
04-22 02:38:51.158    2001-2001/com.example.wolfe_000.final_final_zeno W/Zygote﹕ createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?
04-22 02:38:51.158    2001-2001/com.example.wolfe_000.final_final_zeno I/art﹕ Not late-enabling -Xcheck:jni (already on)
04-22 02:38:51.242    2001-2016/com.example.wolfe_000.final_final_zeno D/OpenGLRenderer﹕ Render dirty regions requested: true
04-22 02:38:51.243    2001-2001/com.example.wolfe_000.final_final_zeno D/﹕ HostConnection::get() New Host Connection established 0xa6c511d0, tid 2001
04-22 02:38:51.255    2001-2001/com.example.wolfe_000.final_final_zeno D/Atlas﹕ Validating map...
04-22 02:38:51.301    2001-2016/com.example.wolfe_000.final_final_zeno D/﹕ HostConnection::get() New Host Connection established 0xa6c51360, tid 2016
04-22 02:38:51.338    2001-2016/com.example.wolfe_000.final_final_zeno I/OpenGLRenderer﹕ Initialized EGL, version 1.4
04-22 02:38:51.389    2001-2016/com.example.wolfe_000.final_final_zeno D/OpenGLRenderer﹕ Enabling debug mode 0
04-22 02:38:51.398    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:38:51.398    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa6c50580, error=EGL_SUCCESS
04-22 02:39:06.938    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:06.938    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa6c500c0, error=EGL_SUCCESS
04-22 02:39:12.811    2001-2001/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ Database Created
04-22 02:39:12.846    2001-2001/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ One Row Inserted
04-22 02:39:12.915    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:12.915    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5b5ccc0, error=EGL_SUCCESS
04-22 02:39:12.993    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:12.993    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5b5cca0, error=EGL_SUCCESS
04-22 02:39:15.068    2001-2001/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ Database Created
04-22 02:39:15.170    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:15.170    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xb0a9b6a0, error=EGL_SUCCESS
04-22 02:39:16.445    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:16.445    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5b5ccc0, error=EGL_SUCCESS
04-22 02:39:16.505    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:16.505    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5b5ccc0, error=EGL_SUCCESS
04-22 02:39:17.484    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:17.484    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5dadb60, error=EGL_SUCCESS
04-22 02:39:24.591    2001-2001/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ Database Created
04-22 02:39:24.664    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:24.664    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa589a500, error=EGL_SUCCESS
04-22 02:39:26.386    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:26.386    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa589af60, error=EGL_SUCCESS
04-22 02:39:27.492    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:27.493    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5dadb60, error=EGL_SUCCESS
04-22 02:39:28.787    2001-2001/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ Database Created
04-22 02:39:28.844    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:28.844    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5844840, error=EGL_SUCCESS
04-22 02:39:28.888    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:28.888    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5dad180, error=EGL_SUCCESS
04-22 02:39:28.987    2001-2016/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:39:28.987    2001-2016/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5844840, error=EGL_SUCCESS
04-22 02:40:43.655    2115-2115/com.example.wolfe_000.final_final_zeno D/﹕ HostConnection::get() New Host Connection established 0xa6c401d0, tid 2115
04-22 02:40:43.724    2115-2115/com.example.wolfe_000.final_final_zeno D/Atlas﹕ Validating map...
04-22 02:40:43.803    2115-2130/com.example.wolfe_000.final_final_zeno D/﹕ HostConnection::get() New Host Connection established 0xa6c404a0, tid 2130
04-22 02:40:43.813    2115-2130/com.example.wolfe_000.final_final_zeno I/OpenGLRenderer﹕ Initialized EGL, version 1.4
04-22 02:40:43.861    2115-2130/com.example.wolfe_000.final_final_zeno D/OpenGLRenderer﹕ Enabling debug mode 0
04-22 02:40:43.867    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:40:43.867    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa6c47260, error=EGL_SUCCESS
04-22 02:40:50.228    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:40:50.228    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5efb760, error=EGL_SUCCESS
04-22 02:40:53.298    2115-2115/com.example.wolfe_000.final_final_zeno D/InputEventConsistencyVerifier﹕ KeyEvent: ACTION_UP but key was not down.
in android.widget.EditText{28c7ebdf VFED..CL .F...... 32,633-736,682 #7f08007c app:id/editText4}
0: sent at 145274000000, KeyEvent { action=ACTION_UP, keyCode=KEYCODE_TAB, scanCode=15, metaState=0, flags=0x8, repeatCount=0, eventTime=145274, downTime=145175, deviceId=0, source=0x101 }
04-22 02:40:54.478    2115-2115/com.example.wolfe_000.final_final_zeno D/InputEventConsistencyVerifier﹕ KeyEvent: ACTION_UP but key was not down.
in android.widget.EditText{1477902c VFED..CL .F...... 32,731-736,780 #7f08007e app:id/editText5}
0: sent at 146453000000, KeyEvent { action=ACTION_UP, keyCode=KEYCODE_TAB, scanCode=15, metaState=0, flags=0x8, repeatCount=0, eventTime=146453, downTime=146300, deviceId=0, source=0x101 }
04-22 02:40:56.040    2115-2115/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ Database Created
04-22 02:40:56.082    2115-2115/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ Table Created
04-22 02:40:56.089    2115-2115/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ One Row Inserted
04-22 02:40:56.156    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:40:56.156    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5dde900, error=EGL_SUCCESS
04-22 02:40:56.243    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:40:56.243    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5dde7c0, error=EGL_SUCCESS
04-22 02:40:58.391    2115-2115/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ Database Created
04-22 02:40:58.475    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:40:58.476    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5dde6e0, error=EGL_SUCCESS
04-22 02:40:58.557    2115-2127/com.example.wolfe_000.final_final_zeno I/art﹕ Background partial concurrent mark sweep GC freed 842(50KB) AllocSpace objects, 0(0B) LOS objects, 39% free, 2MB/3MB, paused 17.937ms total 94.451ms
04-22 02:40:59.665    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:40:59.665    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5dde900, error=EGL_SUCCESS
04-22 02:40:59.742    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:40:59.742    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5dde900, error=EGL_SUCCESS
04-22 02:40:59.806    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:40:59.806    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5b33440, error=EGL_SUCCESS
04-22 02:41:07.133    2115-2115/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ Database Created
04-22 02:41:07.187    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:41:07.187    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa58b93e0, error=EGL_SUCCESS
04-22 02:41:09.150    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:41:09.151    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5b30aa0, error=EGL_SUCCESS
04-22 02:41:10.119    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:41:10.119    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5b33440, error=EGL_SUCCESS
04-22 02:41:11.436    2115-2115/com.example.wolfe_000.final_final_zeno D/Database Operations﹕ Database Created
04-22 02:41:11.481    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:41:11.481    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5b33060, error=EGL_SUCCESS
04-22 02:41:11.513    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:41:11.514    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5b33060, error=EGL_SUCCESS
04-22 02:41:11.587    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:41:11.587    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5809360, error=EGL_SUCCESS
04-22 02:43:51.516    2115-2130/com.example.wolfe_000.final_final_zeno W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-22 02:43:51.516    2115-2130/com.example.wolfe_000.final_final_zeno W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5b33060, error=EGL_SUCCESS

Aucun commentaire:

Enregistrer un commentaire