Package org.apache.jmeter.samplers.jdbc

Examples of org.apache.jmeter.samplers.jdbc.Data


      time = start = end = 0;
      SampleResult res = new SampleResult();
      Connection con = null;
      ResultSet rs = null;
      Statement stmt = null;
      Data data = new Data();
      res.putValue(Sampler.SAMPLE_LABEL,e.getValue(QUERY));
      start = System.currentTimeMillis();
  try {
      while((con = manager.getConnection(key)) == null)
              try{Thread.sleep(10);}catch(Exception err){}
View Full Code Here


@throws java.sql.SQLException
  *************************************/
  private Data getDataFromResultSet(ResultSet rs) throws SQLException
  {
    ResultSetMetaData meta;
    Data data=new Data();
    meta=rs.getMetaData();
    int numColumns = meta.getColumnCount();
    String[] dbCols=new String[numColumns];
    for(int count = 1;count<=numColumns;count++)
    {
       dbCols[count-1]=meta.getColumnName(count);
      data.addHeader(dbCols[count-1]);
    }
    while(rs.next())
    {
      data.next();
      for(int count = 0;count<numColumns;count++)
      {
        Object o=rs.getObject(count+1);
        end = System.currentTimeMillis();
        time += end - start;
        data.addColumnValue(dbCols[count],o);
        start = System.currentTimeMillis();
      }
    }
    return data;
  }// end method
View Full Code Here

TOP

Related Classes of org.apache.jmeter.samplers.jdbc.Data

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.