title: How to send/receive HashMap to/from database using Java and JDBC?
body: <p>A colleague has configured Java and MySQL to {send/receive} = [IN/OUT] parameters as <code>HashMap</code> and returns the result as <code>HashMap</code>. </p>
  
  <p>Is it possible or any third party package required to configure?</p>
  
  <pre><code>public void sendValuesTODatabase(String user_id, String userName) {          
      HashMap hm1 = new HashMap();
      hm1.put("1", user_id);       // Parameters according to the Type
      hm1.put("2", username);
  
  
      int nooftable = 3;           /* represents number of select statements used in Stored           
                                      Procedure */
  
      Vector vCols = new Vector();
      vCols.addElement("1");       // One Column used for selection in Mysql select query 1
      vCols.addElement("2");       // Two Column used for selection in Mysql select query 2
      vCols.addElement("1");       // one Column used for selection in Mysql select query 3
  
      BlobValues bls = new BlobValues();
      HashMap hmap = (HashMap)bls.getGeneric(hm1,"DB_SCHEMA_NAME.SP_PACKAGE_NAME.PROCEDURE_NAME", 
                      nooftable, vCols);
  
      HashMap dBResult1 = (HashMap)hmap.get("GENERICJAVA1"); // Select stmt result1 in HashMap
      HashMap dBResult2 = (HashMap)hmap.get("GENERICJAVA2"); // Select stmt result2 in HashMap
      HashMap dBResult3 = (HashMap)hmap.get("GENERICJAVA3"); // Select stmt result3 in HashMap
  }
  </code></pre>