gpt4 book ai didi

c++ - OCCI - 连接到远程数据库

转载 作者:行者123 更新时间:2023-11-30 03:06:43 26 4
gpt4 key购买 nike

我是 Oracle 的新手。我正在尝试使用 OCCI 连接到远程 Oracle 数据库。到目前为止,我发现的所有示例都是用于连接到本地数据库的。有人可以给我指出正确的方向,让我知道在哪里可以找到示例连接来帮助我解决这个问题吗?谢谢,迈克

最佳答案

createConnection( "name", "passwrd", "string")

"string" stands either for the connection name that is resolved with the Oracle "tnsnames.ora" file which should be located in your ORACLE_HOME(Oracle install dir)\NETWORK\ADMIN directory or for a connection string like below

Code:
connection_name =
(DESCRIPTION =
(ADDRESS=(PROTOCOL = TCP)(HOST = ip_address)(PORT = listener_port))
(CONNECT_DATA= (SERVICE_NAME = listener_service_name)
(SERVER = DEDICATED))
)

关于c++ - OCCI - 连接到远程数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6359661/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com