Ubuntuで次のテスト・プログラムを実行して、インスタント・クライアントOCCIライブラリを使用してOracleデータベースに接続しようとしています。Ubuntu ORA-24960:属性OCI_ATTR_USERNAMEが最大許容長255より大きい
#include <iostream>
#include <occi.h>
using namespace oracle::occi;
int main() {
Environment *env = Environment::createEnvironment(Environment::DEFAULT);
Connection *conn = env->createConnection("user", "1234");
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
}
g++ main.cpp -L ~/instantclient_12_2 -locci -lclntsh -I ~/instantclient_12_2/sdk/include
をコンパイルしかし、私は
terminate called after throwing an instance of 'oracle::occi::SQLException'
what(): ORA-24960: the attribute OCI_ATTR_USERNAME is greater than the maximum allowable length of 255
Aborted
を取得する実行しているとき、私はUbuntuの16.04、GCC 5.4.0を実行していると私は同じ結果を取得するときにエラーがありませんインスタントクライアント11.2および12.2。
これは前に尋ねられています:https://stackoverflow.com/questions/40022118/ora-24960-the-attribute-oci-attr-username-is-greater-than-the-maximumしかし答えはlinuxには当てはまりません(または私はポイントを逃しています)。
ご協力いただければ幸いです。