使用SID和INSTANCE_NAME将oracle与pdo连接 [英] Connect oracle with pdo, with SID and INSTANCE_NAME

查看:50
本文介绍了使用SID和INSTANCE_NAME将oracle与pdo连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用PDO :: __ construct()连接到Oracle.

How do I connect to Oracle using PDO::__construct().

我所拥有的是主机,端口,SID和INSTANCE_NAME.

What I have are the host, port, SID and INSTANCE_NAME.

寻找我建立的信息

 CONNECT username@[//]host[:port][/service_name][:server][/instance_name]

位于 http://docs.oracle.com /cd/E18283_01/network.112/e10836/naming.htm#i498306 ,但我不知道如何将其翻译"为PDO.

at http://docs.oracle.com/cd/E18283_01/network.112/e10836/naming.htm#i498306, but I don't know how to "translate" it to PDO.

推荐答案

尝试一下:

oci:dbname=//host:port/SID/INSTANCE_NAME

并参见 http://www.php.net/手册/zh/ref.pdo-oci.connection.php 了解更多信息. 用户名是单独传递的.

And see http://www.php.net/manual/en/ref.pdo-oci.connection.php for more info. The username is passed separately.

这篇关于使用SID和INSTANCE_NAME将oracle与pdo连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆