0

I am newbie to cake php. How can I configure database.php in cake 2.4 with ODBC as Data Source. The DSN is pointing to Teradata.

1 Answers1

0

Well I don't think there is any support out of the box but I may be very wrong. Can someone who knows the core super-well answer the question?

Otherwise you can extend the DboSource and connect throgh a PDO just like in this example - check the function connect() {......

Keep in mind that this example is UNSTABLE and most-probably very outdated but it can get you started!

Another thing to consider is that PDOs have an ODBC Driver. There is also a separate Abstraction Layer (like PDO) but for ODBC but it is know for some issues - for example, incompatibility with the package php-recode for some reason.

Anyway, in order to connect to your DSN you can use PDO_ODBC DSN

I personally think it is better to access the ODBC DSN through PDO, however your usage scenario way dictate otherwise.

Be sure to open source your datasource if you decide to build one! This will bring benefits to you too as other people will look at the code and make it better.

EDIT: There is a Datasources plugin for CakePHP 2.0 but the Database/Odbc data source is still incompatible with CakePhp 2.x. So you should definitely start there!

Borislav Sabev
  • 4,776
  • 1
  • 24
  • 30