when I try run this code bellow on controller, its fine! returns data from database:
$test = new Phalcon\Db\Adapter\Pdo\Oracle(array(
'adapter' => 'Oracle',
'username' => 'SAAS',
'password' => 'saas',
'dbname' => '//192.168.120.27/XE',
'schema' => 'SAAS'
));
$rs=$test->query("select * from USERS");
print_r($rs->fetchAll());
It's ok! returns data from oracle DB.
When I run this code below, hoping to use the connection as defined in config.:
$user = new Users();
$user->name = 'leandro';
$user->email = '[email protected]';
$user->id = 1;
$user->save();
print_r($user);
die;
My database config session:
'database' => array(
'adapter' => 'Oracle',
'username' => 'TEKNISA_SAAS',
'password' => 'teknisa',
'host' => '192.168.120.27',
'dbname' => 'XE',
'schema' => 'TEKNISA_SAAS'
),
Dont works! :-(
Returns error:
SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. (translated from portuguese)
Trace
#0
Class: PDO
line:#
Function:__construct Array ( [0] => mysql:host=192.168.120.27;dbname=XE;schema=SAAS [1] => SAAS [2] => saas [3] => Array ( [3] => 2 ) )
#1
Class: Phalcon\Db\Adapter\Pdo
line:#
Function:connect Array ( [0] => Array ( [host] => 192.168.120.27 [username] => SAAS [password] => saas [dbname] => XE [schema] => SAAS ) )
#2
Class: Phalcon\Db\Adapter\Pdo
line:#63
Function:__construct Array ( [0] => Array ( [host] => 192.168.120.27 [username] => SAAS [password] => saas [dbname] => XE [schema] => SAAS ) )