

Use the executeQuery(stirng) function if it is a query operation, and the executeUpdate(str) function if it is an addition or deletion.į4 - > Java Vm - > user specified JDK - > Installation path of input jdk, such as: I: Program Files (x86) Java jdk1.6.0_39Īt the end of the setup, click OK to save, compile and prompt: No errors detected, indicating that the compilation passed.īecause some data need to be numbered for inserting data records, such as fields like ID, when setting parameters, choose the parameterized type: UniqueNumber. There is no need to add " " when the required SQL statements are stored as strings.Ĥ. Introducing the resultset set set set class is to store the result set for the query class transaction.ģ. If placed in the action, the connection will be created repeatedly to occupy database resources, which has an impact on the test results.Ģ. dbUrl, user, password, conn, stat, rs are defined as global variables outside the action method because when loadrunner is concurrent, the action method will be executed repeatedly. Lr.end_transaction("insert_into_userinfo",lr.AUTO) ġ. *If the operation type is update, insert, delete, and the executeUpdate method is used, the number of items affected (int) is returned, and if the creat table or drop table is returned with a value of 0.*/ *If the operation type is select, using the excuteQuery method, the query operation returns to the recordset, which needs to be received by rs object.*/ String str="SELECT * FROM APP_USER_INFO" Note that there is no need to add after the SQL statement. *SQL statement for insertion operation*/

*Receive the result set returned by the select operation, if it is an add-delete operation, it is not necessary.*/Ĭlass.forName("").newInstance() Ĭonn = DriverManager.getConnection(dbUrl, user, password)
