[Urgent help] about using OCCI on 64-bit Linux (Redhat)
Source: Internet
Author: User
[Urgent help] for the use of OCCI on 64-bit Linux (Redhat)-General Linux technology-Linux programming and kernel information, see the following for details. Hello, everyone!
The younger brother encountered the problem as shown in the following figure. Previously, he used the Redhat 5.5 32-bit version, and the ORACLE installation was also 32-bit. Therefore, he never considered the 32-bit and 64-bit versions.
In the project, you need to use OCCI to remotely access the database. the program and interface you have written can run on your computer, and cannot be used on the test server (64-bit Linux, 64-bit ORACLE.
The younger brother has also done the following tests. he writes a small program on the test server and calls the occi interface directly with the main function. The following describes the occi database access process and a piece of my code:
OCCI process:
CreateEnvironment; // create an environment variable
CreateConnection; // establish a connection by passing in the user name, password, and connection string
CreateStatement; // create a statement object
ExecuteSQL; // execute the corresponding SQL statement
TerminateStatement;
TerminateConnection;
TerminateEnvironment;
In the main function, part of the code is:
Environment * pEnv = NULL;
Bool bHasException = false;
Try
{
PEnv = Environment: createEnvironment ();
}
Catch (...)
{
BHasException = true;
PEnv = NULL;
}
If (NULL = pEnv)
{
If (bHasException)
Printf ("Create Environment Exception! \ N ");
Else
Printf ("Ceate Environment Failed! \ N ");
Return-1;
}
Printf ("Create Environment Successed! \ N ");
....
Since the test machine is a 64-bit Linux and the ORACLE installation is also 64-bit, during compilation, I have specified the called OCCI Library as the libocci in the ORACLE path. so, the library is also a 64-bit version, and the libstdc ++ prompt is also prompted during compilation. A problem with so.5 is also specified to use/usr/lib64/libstdc ++ during compilation. so.5, so the compilation is successful, !!! The problem is that when the above test program is executed, the output is "segment error" and exceptions cannot be caught.
Then, the younger brother libocci on his 32-bit machine. so and some other dependent libraries are copied to the test machine, and the 32-bit occi Library Copied is specified during compilation, and/usr/lib/libstdc ++ is specified. so.5: specify the-m32 parameter. the compilation is normal. Instead, the prompt "Create Environment into topn!" is displayed during execution! ", I don't understand why the same code can catch exceptions, but cannot catch exceptions. But what's more important is that you do not understand why you cannot create environment variables?
I searched for some OCCI installation and use on the Internet. some netizens installed OCCI on 64-bit Linux systems and wrote programs to access the database. However, none of them encountered such a problem. Therefore, I would like to ask you about this project. this project is too time-consuming. I didn't expect it to be time-consuming. if any of you have encountered such a problem or can help, thank you !!!!
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.