IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Android Discussion :

mise a jour d'un table BDD


Sujet :

Android

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre actif
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2011
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Avril 2011
    Messages : 29
    Par défaut mise a jour d'un table BDD
    salut,
    J'ai créé une base de données, l'utilisateur en cliquant sur un bouton "modifier", je veut mettre à jour les attributs du table

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
     
    public void onClick(View v) {
     
    			Intent thisIntent = getIntent();
    			int id_ = thisIntent.getExtras().getInt("_id");
     
    			String nom_ = edit1.getText().toString();
    			String prenom_ = edit2.getText().toString();
    			String telephone_ = edit3.getText().toString();
    			String mail_ = edit4.getText().toString();
    			String adresse_ = edit5.getText().toString();
    			String gouvernerat_ = edit6.getText().toString();
    			String fonction_ = edit7.getText().toString();
     
     
    			db.updateCorrespondant(id_, nom_, prenom_, telephone_, mail_, adresse_, gouvernerat_, fonction_);
    		}
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
     
    public int updateCorrespondant(int id, String nom,String prenom,String telephone,String mail,String adresse, String gouvernerat,String fonction )
    	{
     
    		ContentValues values = new ContentValues();
     
    		values.put("nom", nom);
    		values.put("prenom", prenom);
    		values.put("telephone", telephone);
    		values.put("mail", mail);
    		values.put("adresse", adresse);
    		values.put("gouvernerat", gouvernerat);
    		values.put("fonction", fonction);
     
    		return db.update(TABLE_corresp, values, "_id="+id,null);
    	}

  2. #2
    Membre actif
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2011
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Avril 2011
    Messages : 29
    Par défaut
    erreur logcat:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
     
    05-19 17:27:25.087: ERROR/vold(538): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)
    05-19 17:27:25.087: ERROR/vold(538): Error bootstrapping switch '/sys/class/switch/test2' (m)
    05-19 17:27:25.087: ERROR/vold(538): Error opening switch name path '/sys/class/switch/test' (No such file or directory)
    05-19 17:27:25.087: ERROR/vold(538): Error bootstrapping switch '/sys/class/switch/test' (m)
    05-19 17:27:25.257: ERROR/flash_image(544): can't find recovery partition
    05-19 17:27:43.508: ERROR/MemoryHeapBase(562): error opening /dev/pmem: No such file or directory
    05-19 17:27:43.508: ERROR/SurfaceFlinger(562): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
    05-19 17:27:43.668: ERROR/GLLogger(562): couldn't load <libhgl.so> library (Cannot find library)
    05-19 17:27:43.807: ERROR/GLLogger(562): couldn't load <libhgl.so> library (Cannot find library)
    05-19 17:27:47.907: ERROR/BatteryService(562): Could not open '/sys/class/power_supply/usb/online'
    05-19 17:27:47.917: ERROR/BatteryService(562): Could not open '/sys/class/power_supply/battery/batt_vol'
    05-19 17:27:47.917: ERROR/BatteryService(562): Could not open '/sys/class/power_supply/battery/batt_temp'
    05-19 17:27:48.717: ERROR/EventHub(562): could not get driver version for /dev/input/mouse0, Not a typewriter
    05-19 17:27:48.808: ERROR/EventHub(562): could not get driver version for /dev/input/mice, Not a typewriter
    05-19 17:27:48.937: ERROR/System(562): Failure starting core service
    05-19 17:27:48.937: ERROR/System(562): java.lang.SecurityException
    05-19 17:27:48.937: ERROR/System(562):     at android.os.BinderProxy.transact(Native Method)
    05-19 17:27:48.937: ERROR/System(562):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
    05-19 17:27:48.937: ERROR/System(562):     at android.os.ServiceManager.addService(ServiceManager.java:72)
    05-19 17:27:48.937: ERROR/System(562):     at com.android.server.ServerThread.run(SystemServer.java:163)
    05-19 17:27:48.947: ERROR/AndroidRuntime(562): Crash logging skipped, no checkin service
    05-19 17:27:50.378: ERROR/LockPatternKeyguardView(562): Failed to bind to GLS while checking for account
    05-19 17:27:55.428: ERROR/ApplicationContext(562): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml
    05-19 17:28:01.310: ERROR/ActivityThread(609): Failed to find provider info for android.server.checkin
    05-19 17:28:04.020: ERROR/ActivityThread(609): Failed to find provider info for android.server.checkin
    05-19 17:28:04.140: ERROR/ActivityThread(609): Failed to find provider info for android.server.checkin
    05-19 17:28:05.041: ERROR/MediaPlayerService(542): Couldn't open fd for content://settings/system/notification_sound
    05-19 17:28:05.051: ERROR/MediaPlayer(562): Unable to to create media player
    05-19 17:28:31.837: ERROR/SurfaceFlinger(562): not enough memory for layer bitmap size=307200
    05-19 17:28:31.837: ERROR/SurfaceFlinger(562): createNormalSurfaceLocked() failed (Out of memory)
    05-19 17:29:25.117: ERROR/AndroidRuntime(728): Uncaught handler: thread main exiting due to uncaught exception
    05-19 17:29:25.147: ERROR/AndroidRuntime(728): java.lang.NullPointerException
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at com.formation.cimsp.Modif1_corresp.onClick(Modif1_corresp.java:110)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.view.View.performClick(View.java:2179)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.view.View.onTouchEvent(View.java:3828)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.widget.TextView.onTouchEvent(TextView.java:6291)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.view.View.dispatchTouchEvent(View.java:3368)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1707)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1197)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.app.Activity.dispatchTouchEvent(Activity.java:1993)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1525)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.os.Handler.dispatchMessage(Handler.java:99)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.os.Looper.loop(Looper.java:123)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at android.app.ActivityThread.main(ActivityThread.java:3948)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at java.lang.reflect.Method.invokeNative(Native Method)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at java.lang.reflect.Method.invoke(Method.java:521)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
    05-19 17:29:25.147: ERROR/AndroidRuntime(728):     at dalvik.system.NativeStart.main(Native Method)

  3. #3
    Membre averti
    Homme Profil pro
    Inscrit en
    Avril 2011
    Messages
    52
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2011
    Messages : 52
    Par défaut
    A partir d'ou tu fais ta mise a jour ?
    est ce dans le code java ou un script que tu appel?

    et tu travail sur quel type de base de données

  4. #4
    Membre chevronné
    Homme Profil pro
    IUT Informatique
    Inscrit en
    Mars 2011
    Messages
    412
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : IUT Informatique

    Informations forums :
    Inscription : Mars 2011
    Messages : 412
    Par défaut
    Balèse ton erreur logCat lol.

    Mais à priori il ne trouve pas un (ou des j'ai pas tout tout lu) fichier et t'as un jolie nullPointerException, et d'autre info

    05-19 17:28:05.051: ERROR/MediaPlayer(562): Unable to to create media player
    05-19 17:28:31.837: ERROR/SurfaceFlinger(562): not enough memory for layer bitmap size=307200
    05-19 17:28:31.837: ERROR/SurfaceFlinger(562): createNormalSurfaceLocked() failed (Out of memory)
    05-19 17:29:25.117: ERROR/AndroidRuntime(728): Uncaught handler: thread main exiting due to uncaught exception
    05-19 17:29:25.147: ERROR/AndroidRuntime(728): java.lang.NullPointerException
    05-19 17:29:25.147: ERROR/AndroidRuntime(728): at com.formation.cimsp.Modif1_corresp.onClick(Modif1_corresp.java:110)

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. probleme de mise a jour d'une table
    Par blackchild dans le forum Requêtes
    Réponses: 4
    Dernier message: 20/09/2006, 20h55
  2. Mise a jour d'une table
    Par mael94420 dans le forum ASP
    Réponses: 4
    Dernier message: 21/07/2006, 12h24
  3. mise a jour d'une table
    Par el_quincho dans le forum Access
    Réponses: 1
    Dernier message: 10/05/2006, 16h11
  4. [SGBD] [MySQL] Problème de mise à jour d'une table
    Par philippef dans le forum SQL Procédural
    Réponses: 1
    Dernier message: 13/01/2006, 15h42
  5. Mise a jour d'une table
    Par cterpreau dans le forum SQL Procédural
    Réponses: 1
    Dernier message: 01/12/2005, 18h35

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo