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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -