Zend_db can't connect on iSeries

For programming and general questions on Zend Framework
Post Reply
mhopkins
Posts: 4
Joined: Tue Apr 21, 2009 3:38 pm

Zend_db can't connect on iSeries

Post by mhopkins » Tue Apr 21, 2009 3:46 pm

Can't figure out why I get this error when I run this test code on our iSeries server.
Zend_db complains the same about any database I try. If I use the built in php db2 functions it works fine.
Getting connection...
Zend_Db_Adapter_Db2_Exception
Relational database J3000 not in relational database directory. SQLCODE=-950

Code: Select all

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";
}




ledahu
Posts: 19
Joined: Mon Mar 23, 2009 9:36 am

Re: Zend_db can't connect on iSeries

Post by ledahu » Wed Apr 22, 2009 7:09 pm

Please verify with wrkrdbdire that J3000 is define as local database.
This is your error message.

Post Reply