plugging oracle in to my zend app

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

plugging oracle in to my zend app

jalexander3
Hello all,

I have written my application to speak with a mySql database. My understanding of the framework is that it conveniently wraps all the backend calls and should allow me to simply change some configuration settings in order to change databases.

I presume this is done in the application.ini file where I previously had (currently commented out)

;resources.db.adapter = PDO_MYSQL
;resources.db.isDefaultTableAdapter = true
;resources.db.params.charset = "utf8"
;resources.db.params.host = "localhost"
;resources.db.params.username = "root"
;resources.db.params.password = ""
;resources.db.params.dbname = "taw"

I have used this as a guide to pointing to my newly installed Oracle database (with a new user "myUser")

resources.db.adapter = PDO_OCI
resources.db.params.port = "8081"
resources.db.isDefaultTableAdapter = true
resources.db.params.charset = "utf8"
resources.db.params.host = "localhost"
resources.db.params.username = "myUser"
resources.db.params.password = "myPassword"
resources.db.params.dbname = "xe"

I have also uncommented the following line in my php config file:
extension=php_pdo_oci.dll

As soon as I log in to my application I get the error:

Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: pdo_oci_handle_factory: ORA-12537: TNS:connection closed (ext\pdo_oci\oci_driver.c:579)' in C:\xampp\htdocs\TAW\library\Zend\Db\Adapter\Pdo\Abstract.php:129

I understand that this could be an Oracle configuration issue, I just want to rule out the possibility of the problem being on the application side.

Note that my application works fine when connecting to the mySql database. All params seem to be correct, as well.

Does anyone have any suggestions?

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: plugging oracle in to my zend app

jalexander3
For the sake of helping someone else out, here is what happened:

phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
resources.db.adapter = PDO_OCI
[b]resources.db.params.port = "1521"[/b]
resources.db.isDefaultTableAdapter = true
resources.db.params.charset = "utf8"
resources.db.params.host = "localhost"
resources.db.params.username = "myUser"
resources.db.params.password = "myPass"
resources.db.params.dbname = "XE"
[b]resources.db.params.options.autoQuoteIdentifiers  = false[/b]
resources.db.params.options.caseFolding = 2

My initial problem was solved by simply getting the port number correct. Also, Oracle is a bit finicky with quotes, and so the autoQuoteIdentifiers param was needed.

All in all, Zend Framework documentation fail (not to mention community support fail). But I got it on my own eventually. Will be pushing for .NET at my work from now on...
Loading...