我必须使用旧数据库驱动程序(ora_logon),而不是cakephp支持使用Oracle数据库。我不能使用oci驱动程序。如何使用cakephp 2与自定义数据库连接和原始查询
现在我做如下: 每个模型的每个方法连接到数据库和retrive数据
class SomeClass extends Model {
public function getA(){
if ($conn=ora_logon("username","password"){
//make the query
// retrive data
//put data in array and return the array
}
}
public function getB(){
if ($conn=ora_logon("username","password"){
//make the query
// retrive data
//put data in array and return the array
}
}
}
我知道这是不是最好的方法去。 我怎么能离开cakephp管理打开和关闭数据库的连接,并让模型只回收数据?我对任何数据库抽象层不感兴趣。谢谢