Connect ariadne to an oracle db.

20 views
Skip to first unread message

Michele

unread,
Apr 15, 2013, 8:01:41 AM4/15/13
to ariad...@googlegroups.com
Hello,

could you help me with a connection to an oracle db?

I'm using the connect module in this way:

  $db = ar('connect/db')->client('oci:dbname=ipaddress:port/dbname','username','password'); 

Is this correct?

Thank you in advance,
Michele

Auke van Slooten

unread,
Apr 16, 2013, 2:44:36 AM4/16/13
to ariad...@googlegroups.com
On 15-4-2013 14:01, Michele wrote:
Hello,

could you help me with a connection to an oracle db?

I'm using the connect module in this way:

  $db = ar('connect/db')->client('oci:dbname=ipaddress:port/dbname','username','password'); 

Is this correct?

Hi,

It looks correct to me. If it doesn't work, try php's PDO with that dsn 
as well, perhaps it will tell you what went wrong if ar\connect\db 
doesn't. Although the result $db should be an error if the connection 
failed. You can check it like this:

$db = ...;
if ( ar('error')->isError( $db ) ) {
     echo 'Error: '.$db;
}

regards,
Auke van Slooten
Muze

Ps. there is a bug in ar('error'), if you need to use ar('error') 
multiple times in a single template you should assign it to a temporary 
variable and use that, as it sometimes gets corrupted after the first 
call. So do this:

$error = ar('error');
if ( $error->isError($db) ) {
  ...


Michele

unread,
Apr 23, 2013, 6:24:08 AM4/23/13
to ariad...@googlegroups.com
Thank you Auke.

I got the following error
-------
Error: 0: could not find driver
-------

Trying a php connection on the same server but out of ariadne everythings gone well.

Michele
Reply all
Reply to author
Forward
0 new messages