mhopkins9901
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_Except ion
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.
Getting connection...
Zend_Db_Adapter_Db2_Except
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";
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.