ORA-24399:invalid number of connections specified

在使用OCCI数据库接口,创建连接池时报ORA-24399:invalid number of connections specified错误。这个错误是由创建连接函数参数匹配问题造成的。

原来的代码使用StatelessConnectionPool连接池时没有问题,只是换成普通ConnectionPool连接池时报这个错。查看Oracle的文档发现;

StatelessConnectionPool* createStatelessConnectionPool(
const string &poolUserName,
const string &poolPassword,
const string connectString="",
unsigned int maxConn=1,
unsigned int minConn=0,
unsigned int incrConn=1,
StatelessConnectionPool::PoolType
pType=StatelessConnectionPool::HETEROGENEOUS);

ConnectionPool* createConnectionPool(
const string &poolUserName,
const string &poolPassword,
const string &connectString = "",
unsigned int minConn = 0,
unsigned int maxConn = 1,
unsigned int incrConn = 1);

注意看minConn和maxConn两个参数在两个函数中的顺序,在createStatelessConnectionPool中,先是maxConn,然后是minConn;而在createConnectionPool中正好相反。(故意搞笑吗????)


你可能感兴趣的:(oracle,数据库,String,文档)