一、建立測試計畫,新增執行緒組
二、執行緒組中新增配置元件jdbc connection configuration
validation query:乙個驗證資料庫仍然響應的簡單查詢語句。預設是jdbc驅動的 『isvalid()』 方法,它適合於很多資料庫。可以通過jmeter.properties中jdbc.config.check.query屬性設定預設的驗證sql語句,有10個選項:hsqldb select 1 from information_schema.system_users;oracle select 1 from dual;db2 select 1 from sysibm.sysdummy1;mysql select 1;microsoft sql server (ms jdbc driver) select 1;postgresql select 1;ingres select 1;derby values 1;h2 select 1;firebird select 1 from rdb$database。
database url格式:jdbc:mysql://[host:port],[host:port].../[database][?引數名1][=引數值1][&引數名2][=引數值2]...
--有時候會加上字元編碼等解決報錯,如 jdbc:mysql://ip:3306/資料庫名?useunicode=true&characterencoding=utf8&allowmultiqueries=true
jdbc driver class:通常都是選擇 com.mysql.jdbc.driver
三、執行緒組中新增取樣器jdbc request
四、執行指令碼,檢視結果樹
Jmeter 連線資料庫
一 與sqlite資料庫 一 設定當前專案中的資料庫連線 先安裝一款sqlite 資料庫的視覺化管理工具。直接將工具解壓到相應的目錄下,然後啟動,設定相應的語言版本,最後在軟體中建立資料庫連線 按著提示找到我們的自身資料庫檔案所在位址開啟即可 此時我們就可以在該工具中得到當前資料庫裡對應的表及表中的...
jmeter連線資料庫
variable name 該名稱自定義,在jdbc request會用到 jdbc driver class com.mysql.jdbc.driver username 資料庫連線使用者名稱 password 資料庫連線密碼 jdbc request中的variable name 與jdbc c...
jmeter連線資料庫
2 執行緒組右鍵 新增 配置原件 jdbc connection configuration元件 database url jdbc mysql 其中有hostip位址 登入資料庫的host位址 埠號固定3306,還有就是資料庫使用者名稱 如下截圖 3 新增sampler jdbc request元...