Re: Not able to connecto ORACLE data base by webservices protocol. (402 Views)
Reply
Occasional Contributor
shivamgupta
Posts: 9
Registered: ‎02-29-2012
Message 1 of 4 (696 Views)

Not able to connecto ORACLE data base by webservices protocol.

HI ,

I have written below code to connect to ORACLE database from Vugen ,the database is oracle.

but getting exeception that "ORA-12154: TNS:could not resolve the connect identifier specified

but i am able to do tnsping from the machine,please help me to solve the issue.

 

Code

user_init()
{
int i=0,j;
lr_output_message("The value of i is %d",i);
lr_db_connect("StepName=PERFTEST","ConnectionString=DATA SOURCE=jdbc:oracle:thin:@<DB_SERVER_IP>:<PORT>:<SID_NAME>;User Id=<USER_ID>;Password=<PASSWORD>",
"ConnectionName=PERFTEST",
  "ConnectionType=ORACLE",
   LAST );
if(i==1)
{   
lr_output_message("The value of i is %d",i);
 lr_error_message("Connection Successful");
 }
else
lr_error_message("Cannot login to database");
j=lr_db_executeSQLStatement("StepName=TestDatabaseConnection1",
  "ConnectionName=DatabaseConnection",
  "SQLStatement=select * from tab",
  "DatasetName=TestDataset"
   LAST);
                if(j==1)
                {   
                                lr_output_message("The value of i is %d",j);
                                lr_error_message("Dataset Created");
                }
                else
                                lr_error_message("Dataset Not created");
          return 0;
}

 

 

Error

vuser_init.c(4): The value of i is 0
vuser_init.c(7): DB Connection "PERFTEST" started ... Wait ....
vuser_init.c(7): Error: DB Connection failed {"ORA-12154: TNS:could not resolve the connect identifier specified
"}
vuser_init.c(7): Error: DB Connection failed {"PERFTEST"}

Please use plain text.
HP Expert
Editus
Posts: 639
Registered: ‎04-06-2011
Message 2 of 4 (642 Views)

Re: Not able to connecto ORACLE data base by webservices protocol.

Hello 

the statement

 lr_db_connect("StepName=PERFTEST","ConnectionString=DATA SOURCE=jdbc:oracle:thin:@<DB_SERVER_IP>:<PORT>:<SID_NAME>;User Id=<USER_ID>;Password=<PASSWORD>",

 

lookd like that for posting purposes right? if not work on get this fixed, is all wrong. if yes then check on the TNS names file the SID or SERVICE NAME youare using must be the same as the connection identifier, and by the way the connection you are calling form this statement must exist in there.

 

regards

Please use plain text.
Occasional Contributor
shivamgupta
Posts: 9
Registered: ‎02-29-2012
Message 3 of 4 (630 Views)

Re: Not able to connecto ORACLE data base by webservices protocol.

Hi ,

 

Entries are there in the TNS file with the connection name that we are specifying.But still it is throwing that error.I would like to know do we have to add any extra parameter in the lr_db_connect_function to get it working properl.

 

We are able to connect to the DB normally using SQLplus and also able to ping the server where the DB resides.

 

Also when i am doing a tnsping with the connection name it is showing the connection string

 

 

 

Please use plain text.
Occasional Advisor
DanielRojas
Posts: 7
Registered: ‎08-30-2011
Message 4 of 4 (402 Views)

Re: Not able to connecto ORACLE data base by webservices protocol.

This could be due to a problem with the Oracle Client.

Make sure that the ORACLE_HOME and PATH variables are configured properly, and install VuGen in C drive (or path with no especial character).

 

Reference : 

 
Hope this helps.
HP Support

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation