远程数据库: 主机ip:192.168.1.98
数据库用户名:scott
数据库密码:tiger
数据库SID:denver1
数据库端口:1521Environment *env = Environment::createEnvironment();Connection *conn = env->createConnection("scott", "tiger" ,不会写了);

解决方案 »

  1.   

    Connection *conn = env->createConnection("scott", "tiger" ,"denver1");
      

  2.   

    我用了 报错terminate called after throwing an instance of 'oracle::occi::SQLException'
      what():  ORA-12154: TNS:could not resolve the connect identifier specifiedAborted
      

  3.   

    我的  .bash_profile
    文件内容是: # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATH
    unset USERNAMEORACLE_SID=denver1
    ORACLE_BASE=/u01
    ORACLE_HOME=/u01/oracle
    PATH=$ORACLE_HOME/bin:$PATH
    LD_ASSUME_KERNEL=2.4.1
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
    export ORACLE_SID ORACLE_BASE ORACLE_HOME PATH LD_ASSUME_KERNEL LD_LIBRARY_PATH
    stty erase ^h
    DISPLAY=192.168.1.4:0; export DISPLAY