Bonjour j'essaye dinserer une byte array dans mon bdd cependant cela ne marche pas ni avec une methode d'insertion classique ni avec un blob

voici mon code

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
 
 
 
				//Methode 1
				Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.myicontest); //jute un exemple 
				ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
				bitmap.compress(CompressFormat.PNG, 0 , bos); 
				byte[] bitmapdata = bos.toByteArray();
 
				myDb = openOrCreateDatabase("mybd", MODE_PRIVATE, null);
 
				myDb.execSQL("INSERT INTO Picture(JobId, Picture, date, user ) VALUES (" +jobId + ", '@" +
				bitmapdata + "', '" + utils.GetDate() +"', " + userId +")" );
 
 
				//Methode 2
 
				SQLiteStatement insertStmt =  myDb.compileStatement(sql);
 
		   	      insertStmt.clearBindings();
		   	      insertStmt.bindString(1,jobId);
		              insertStmt.bindBlob(2,bitmapdata );
		   	      insertStmt.bindString(3,utils.GetDate());
		   	      insertStmt.bindString(4,userId);  	  
 
		   	    insertStmt.executeInsert();
 
 
				//Exception
 
				02-27 14:41:56.376: D/AndroidRuntime(13879): Shutting down VM
				02-27 14:41:56.376: W/dalvikvm(13879): threadid=1: thread exiting with uncaught exception (group=0x4125c2a0)
				02-27 14:41:56.376: E/AndroidRuntime(13879): FATAL EXCEPTION: main
				02-27 14:41:56.376: E/AndroidRuntime(13879): java.lang.NullPointerException
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at com.example.myappwng.SignAndPic$3.onClick(SignAndPic.java:178)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at android.view.View.performClick(View.java:4222)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at android.view.View$PerformClick.run(View.java:17273)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at android.os.Handler.handleCallback(Handler.java:615)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at android.os.Handler.dispatchMessage(Handler.java:92)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at android.os.Looper.loop(Looper.java:137)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at android.app.ActivityThread.main(ActivityThread.java:4895)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at java.lang.reflect.Method.invokeNative(Native Method)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at java.lang.reflect.Method.invoke(Method.java:511)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
				02-27 14:41:56.376: E/AndroidRuntime(13879): 	at dalvik.system.NativeStart.main(Native Method)
				02-27 14:42:09.509: I/Process(13879): Sending signal. PID: 13879 SIG: 9
//Limage recuperer nest pas null.

avez vous des idees pour linsertion des images ou des pistes de recherches pour resoudre ce probleme? ai-je omis une manipulation supplementaires ?

Je vous remercie par avance