I created a DB in mysql workbunch and i stor picture in it as as type blob.
Now I want to use this picture in my app,
Class.forName("com.mysql.jdbc.Driver");
try(Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sys", "root", "Elior204")){
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT img FROM Sentences where id=1");
ImageView image = (ImageView) findViewById(R.id.imageView1);
Blob b =rs.getBlob(1);
int blobLength = (int) b.length();
byte[] blobAsBytes = b.getBytes(1, blobLength);
Bitmap btm =BitmapFactory.decodeByteArray(blobAsBytes,0,blobAsBytes.length);
image.setImageBitmap(btm );
con.close();
The question is, how I continue?