diff --git a/classes/Kohana/Database/DB2.php b/classes/Kohana/Database/DB2.php index e571769..cdf5a93 100644 --- a/classes/Kohana/Database/DB2.php +++ b/classes/Kohana/Database/DB2.php @@ -37,7 +37,6 @@ class Kohana_Database_DB2 extends Database { 'port' => '', 'password' => '', 'persistent' => FALSE, - 'schema' => '', )); // Get user login details from user session - these are set by login @@ -75,9 +74,8 @@ class Kohana_Database_DB2 extends Database { $e->getCode()); } - if (! $this->_connection) { - throw new Database_Exception('Connection to DB2 failed? (:error)', array(':error'=>db2_conn_errormsg())); - } + if (! $this->_connection) + throw new Database_Exception('Connection failed (:error)',array(':error'=>db2_conn_errormsg()),db2_conn_error()); // \xFF is a better delimiter, but the PHP driver uses underscore $this->_connection_id = sha1($hostname.'_'.$username.'_'.$password); @@ -129,9 +127,7 @@ class Kohana_Database_DB2 extends Database { Profiler::delete($benchmark); } - throw new Database_Exception(':error [ :query ]', - array(':error' => db2_stmt_errormsg(), ':query' => $sql), - db2_stmt_error()); + throw new Database_Exception(':error [ :query ]',array(':error' => db2_stmt_errormsg(), ':query' => $sql),db2_stmt_error()); } if (isset($benchmark)) @@ -182,10 +178,10 @@ class Kohana_Database_DB2 extends Database { { // Find all column names try { - $result = db2_columns($this->_connection,NULL,'%',$table); + $result = db2_columns($this->_connection,NULL,$this->_config['connection']['schema'] ? $this->_config['connection']['schema'] : '%',$table); } catch (Exception $e) { - throw new Kohana_Exception('Unable to show DB Columns :table (:connection)',array(':table'=>$table,':connection'=>$this->_connection)); + throw new Database_Exception('Unable to obtain Columns for :table [:error]',array(':table'=>$table,':error' => db2_stmt_errormsg()),db2_stmt_error()); } } diff --git a/classes/Model/DEFAULT.php b/classes/Model/DEFAULT.php new file mode 100644 index 0000000..b0be1d0 --- /dev/null +++ b/classes/Model/DEFAULT.php @@ -0,0 +1,16 @@ +