使用Oracle数据库与CakePHP 2.0 [英] Using Oracle database with CakePHP 2.0

查看:204
本文介绍了使用Oracle数据库与CakePHP 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到目前在CakePHP 2.0中没有Oracle的数据源,虽然看起来他们现在正在工作: http://ask.cakephp.org/questions/view/any_news_about_oracle_datasource_with_cakephp_2_0

I have noticed there's no datasource for Oracle in CakePHP 2.0 for the moment, although it seems they are working on in it now: http://ask.cakephp.org/questions/view/any_news_about_oracle_datasource_with_cakephp_2_0

有些人解释如何使用Oracle DB修改CakePHP 1.3中的一些代码:
http://www.hassanbakar.com/2012/01/09/using-oracle-in-cakephp-2-0/
http://liamgraham.wordpress.com/2007/04/19/using- oracle-with-cakephp-15-minute-blog-tutorial /

There are some people explaining how to use an Oracle DB adapting some code from CakePHP 1.3: http://www.hassanbakar.com/2012/01/09/using-oracle-in-cakephp-2-0/ http://liamgraham.wordpress.com/2007/04/19/using-oracle-with-cakephp-15-minute-blog-tutorial/

但我不确定这是正确的方法。如果这么简单,他们会发布的功能已经为CakePHP 2.X ...

But I'm not sure that's the correct way. If it was so simple, they would have released the feature already for CakePHP 2.X...

我有任何麻烦使用cheat

我想将CakePHP与PL / SQL过程和桌面应用程序连接,他们正在使用Oracle。我不能改变。

I want to connect CakePHP with PL/SQL procedures and a desktop application and they are working over Oracle. I can not change that.

推荐答案

在问了一些CakePHP开发人员后,我得出的结论是不可能使用Oracle数据库与CakePHP 2.3如果你想正确使用CakePHP模型及其查询语法。因此,我发现的解决方案是使用

After asking some CakePHP developers I came out with the conclusion that it is not possible to use an Oracle Database with CakePHP 2.3 if you want to make a proper use of CakePHP Models and their query syntax. There's no yet available any driver for Oracle in CakePHP which is completely functional.

.net / manual / en // function.oci-parse.php> PHP的OCI8函数

Therefore, the solution I found was to use the OCI8 Functions of PHP.

像这样我可以使用 oci_parse 直接查询DB,或者调用一个PL-SQL过程,这是我最后决定做的。 (因为我的工作组中的sql函数复杂性和任务的划分)

Like this i could use oci_parse to directly query against the DB or rather call a PL-SQL procedure which is what I finally decided to do. (because of the sql functions complexity and the division of task inside my work group)

现在,我不能利用CakePHP模型的许多优点,这是唯一的办法。

Now, I can not make use of many of the advantages of using CakePHP models, but It was the only way.

这篇关于使用Oracle数据库与CakePHP 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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