03-26-04, 10:26 #1Registered User
- Join Date
- Mar 2004
- St. Louis
Unanswered: Segmentation fault while connecting to an Oracle Database
I am having an issue connecting to a database within my Pro*C application.
I am writing this in RedHat ES 2.1. With the Oracle 9i Database.
From all the documentation on the web I feel my code is correct but For some reason when I isseue the EXEC SQL CONNECT command it loops through this command until it recieves the Segmentation Fault Message and then dies.
Below is an expert of the code that I have written. It is the Connect Function.
Any Help is greatly Appreciated.
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL END DECLARE SECTION;
strncpy ((char *)username.arr, "monitor@peso_custom", UNAME_LEN);
username.len = strlen((char *) username.arr);
strncpy ((char *)password.arr, "monitor", PWD_LEN);
password.len = strlen((char *) password.arr);
printf("Have assigned all Username and password.\n");
printf("\nGoing to connect to ORACLE as user %s at %s.\n", username.arr);
EXEC SQL WHENEVER SQLERROR GOTO connect_error;
EXEC SQL CONNECT :username IDENTIFIED BY :password;
printf("\nConnected to ORACLE as user %s.\n", username.arr);
fprintf(stderr, "Failed to Connect to Oracle as %s : \n", username.arr);
03-26-04, 11:21 #2Registered User
Provided Answers: 1You can lead some folks to knowledge, but you can not make them think.
- Join Date
- Aug 2003
- Where the Surf Meets the Turf @Del Mar, CA
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Good judgement comes from experience. Experience comes from bad judgement.