Oracle,PDO_OCI与OCI8 [英] Oracle, PDO_OCI vs OCI8
问题描述
我工作的公司目前使用一些基本功能来抽象OCI库,以实现数据库连接.我们正在考虑切换到PHP的PDO对象,但是通过一些快速搜索,看起来Oracle驱动程序比其他PDO驱动程序还不成熟.在生产环境中使用过PDO/oci8的人,我将不胜感激.
The company I work for currently uses some basic functions to abstract the OCI libraries as a means for DB connectivity. We're considering switching to PHP's PDO object, but from some quick searches, it looks like the Oracle driver is a bit less mature than the other PDO drivers. I would appreciate some pro/cons for PDO/oci8 from anyone who has used it in a production environment.
谢谢!
推荐答案
在我看来,Oracle对开发用于PDO的驱动程序不感兴趣,它正在开发自己的驱动程序以使您与oracle数据库保持密切联系...到oracle驱动程序...等等:)
It seems to me that Oracle is not interested in developing a driver for PDO it's developing it's own driver to keep you close to oracle database... to oracle driver... etc. :)
据我所知,如果您能应付max. VARCHAR2的文本为4000 CHARS.如果需要CLOB(和/或更大),请不要使用PDO_OCI.
As far as I've seen there is no problem if you can cope with max. texts of VARCHAR2 of 4000 CHARS. If you need CLOBs (and/or bigger) don't go with PDO_OCI.
我创建了一组"PDOSurrogate"类,以代替使用Oracle的PDO. 当PDO足够成熟时,我可以使用Refactor-> Rename将其更改为PDO.
I've created a suite of classes "PDOSurrogate" as a drop in replacement for PDO with Oracle. When PDO is mature enough I can use Refactor->Rename to change it to PDO.
这篇关于Oracle,PDO_OCI与OCI8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!