Link to home
Start Free TrialLog in
Avatar of mhopkins9901
mhopkins9901Flag for United States of America

asked on

Zend_db on iSeries - can't find database

Trying to use Zend_db on our iseries(as400) server. When running this simple test code. I get this error:
Getting connection...
Zend_Db_Adapter_Db2_Exception
Relational database J3000 not in relational database directory. SQLCODE=-950

I have been using Zend in may applications on this server but not a lot of the framework. I have many php applications that query this database successfully using db2_exec() and the other db2 functions built into php.

I can't figure out why Zend_db gripes when trying to connect to this or any other database on this server.
require_once ("Zend/Db.php");
try {
$params = array (
'host' => 'localhost',
'username' => 'username',
'password' => 'password',
'dbname' => 'J3000'
);
 
$db = Zend_Db::factory ( 'Db2', $params );
 
echo "Getting connection...<br />\n";
$db->getConnection();
 
echo "Closing connection...<br />\n";
$db->closeConnection();
 
} catch ( Zend_Db_Adapter_Exception $e ) {
echo get_class ( $e ) . "<br />\n";
echo $e->getMessage() . "<br/>\n";
 
} catch ( Zend_Exception $e ) {
echo get_class ( $e ) . "<br />\n";
echo $e->getMessage() . "<br />\n";
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of mhopkins9901
mhopkins9901
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial