java - Getting blob image in mysql using restful web service -


i've done listing strings name etc. i've got problem in retrieving image. here's code of retrieving it. in arraylist. don't know if i'm getting right output. please me. here's code

public arraylist<objects> gettaxidetails(connection con, string taxi_plate_no) throws sqlexception{     arraylist<objects> taxidetailslist = new arraylist<objects>();     preparedstatement stmt = con.preparestatement("select * taxi_driver taxi_plate_no = '" +taxi_plate_no+ "'");     //preparedstatement stmt = con.preparestatement("select * taxi_driver");     resultset rs = stmt.executequery();     try{         byte[] bytes = null;         while(rs.next()){              objects taxiobjects = new objects();               taxiobjects.setdriver_contact_no(rs.getstring("driver_contact_no"));             taxiobjects.setdriver_name(rs.getstring("driver_name"));             taxiobjects.settaxi_plate_no(rs.getstring("taxi_plate_no"));             taxiobjects.setdriver_operator(rs.getstring("driver_operator"));             taxiobjects.setdriver_operator_address(rs.getstring("driver_operator_address"));              taxiobjects.setimage(rs.getbytes("image"));              blob image = rs.getblob(1);                byte[] allbytesinblob = image.getbytes(1, (int) image.length());              taxidetailslist.add(taxiobjects);          }     } catch (sqlexception e){         e.printstacktrace();     } return taxidetailslist; } 

here's output

the output this.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

php - Symfony 2: "No route found for "GET /" - error on fresh installation -