title: how to convert blob data into byte array and get image from DB and send it to UI through rest api
body: <pre><code>    @Override
      public byte[] findByusernameAndtenantId(String username,int tenantId) throws SQLException {
  
  
           Connection con=null;
           Blob img ;
            byte[] imgData = null ;
          try {
              Class.forName("org.apache.cassandra.cql.jdbc.CassandraDriver");
  
  
          con=DriverManager.getConnection("jdbc:cassandra://169.46.155.77:9042/demo");
  
  
          String query = "SELECT PHOTO FROM  demo.IGNITE_USERS where USER_NAME=? and TENANT_ID=?";
  
          Statement stmt = con.createStatement();
          ResultSet result = stmt.executeQuery(query);
  
          while (result.next ())
          {   
            img = result.getBlob(1);
            imgData = img.getBytes(1,(int)img.length());
  
          }   
          result.close();
          stmt.close();
  
          }  catch (ClassNotFoundException e) {
              e.printStackTrace();
          } catch (SQLException e) {
              e.printStackTrace();
          } finally {
  
              if (con != null)
              try{
  
                      con.close();
                  } 
              catch (SQLException e) {
                   e.printStackTrace();
                  }
                  con = null;
                 }
  
             return imgData ; 
      }
  </code></pre>
  
  <p>this is my implementation code . </p>
  
  <pre><code>@RequestMapping(value ="/Image",method = RequestMethod.POST, produces="image/jpg")
        public ResponseEntity&lt;byte[]&gt; getImage(@RequestParam String username,@RequestParam int tenantId) throws  SQLException 
        {
          byte[] img=null;
          img=authService.findByusernameAndtenantId(username,tenantId);
          System.out.println("testing functionality");
          return new ResponseEntity&lt;byte[]&gt;(img, HttpStatus.OK);
          } 
  </code></pre>
  
  <p>this is my controller code </p>
  
  <p>when I run the spring boot program , and do a POST call in Postman client to get the image I am getting Class not found exception : org.apache.cassandra.cql.jdbc.Cassandra Driver. </p>
  
  <p>Can you please help me  how to  return that image from cassandra DB stored as Blob ?</p>