在用occi链接数据库的时候 总是出错 求高人指点
下面是我的源代码:
Environment *env = Environment::createEnvironment(" ZHS16GBK " , " UTF8 ");
if (env == NULL)
{
printf("env create failed\n");
}
Connection *conn = NULL;
try
{
const string user = "luoxp";
const string pass = "123456";
const string connstr = "192.168.1.102/LXP";
//conn = env->createConnection(this->m_pUser,this->m_pPassword,this->m_pDBName);
conn = env->createConnection(user,pass,connstr);
}
catch(SQLException excp)
{
cout<<"exception: " <<excp.what()<<endl;
} string strsql = "select * from ";
Statement *stmt = conn->createStatement(strsql);
ResultSet *rs = stmt->executeQuery(); while(rs->next() == true)
{
}
stmt->closeResultSet(rs);
Environment::terminateEnvironment(env);总是在createconnection的时候出错
最后打印的错误值代码是:ora-24399 :指定连接数无效
我的oracle 配置文件是:
LXP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.102)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
)
)LISTENER_LXP =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)oracle能够用PL/SQL能够连接上数据库
下面是我的源代码:
Environment *env = Environment::createEnvironment(" ZHS16GBK " , " UTF8 ");
if (env == NULL)
{
printf("env create failed\n");
}
Connection *conn = NULL;
try
{
const string user = "luoxp";
const string pass = "123456";
const string connstr = "192.168.1.102/LXP";
//conn = env->createConnection(this->m_pUser,this->m_pPassword,this->m_pDBName);
conn = env->createConnection(user,pass,connstr);
}
catch(SQLException excp)
{
cout<<"exception: " <<excp.what()<<endl;
} string strsql = "select * from ";
Statement *stmt = conn->createStatement(strsql);
ResultSet *rs = stmt->executeQuery(); while(rs->next() == true)
{
}
stmt->closeResultSet(rs);
Environment::terminateEnvironment(env);总是在createconnection的时候出错
最后打印的错误值代码是:ora-24399 :指定连接数无效
我的oracle 配置文件是:
LXP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.102)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
)
)LISTENER_LXP =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)oracle能够用PL/SQL能够连接上数据库
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货