LoadRunner How to connect to an Oracle database

Source: Internet
Author: User


LoadRunner How to connect to an Oracle database




Recently doing a test database performance project, directly write out the connection database and database query and insert the script
In Vuser_init (connect to database)


#include "Lrd.h"

Static Lrd_init_info Initinfo = {Lrd_init_info_eyecat};

Static lrd_default_db_version dbtypeversion[] =

{

{Lrd_dbtype_none, Lrd_dbversion_none}

};
Static Lrd_connection * CON1;
Static Lrd_cursor * CSR1;
Vuser_init ()
{
Lrd_init (&initinfo, dbtypeversion);

Lrd_open_connection (&con1, lrd_dbtype_oracle, "username", "password", "Service Name", "", 0, 0, 0);


}
Action (for database operations)
Action ()
{


Lr_start_transaction ("INSERT");

Lrd_open_cursor (&CSR1, Con1, 0);
Lrd_open_cursor (&CSR1, Con1, 0);
Lrd_stmt (CSR1, "SQL statement",-1, 0, 1, 0);

Lrd_exec (CSR1, 0, 0, 0, 0, 0);

/*

PrintRow2, 0);

Lrd_close_cursor (&CSR1, 0);
*/

Lrd_commit (0, Con1, 0);


Lr_end_transaction ("INSERT", Lr_auto);

}
Vuser_end (freeing resources, shutting down the database)
Vuser_end ()
{
Lrd_close_connection (&con1, 0, 0);

Lrd_end (0);

return 0;
}


LoadRunner How to connect to an Oracle database


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.