![]() |
HELP!!! Connecting to Oracle 9i - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: HELP!!! Connecting to Oracle 9i (/showthread.php?tid=24247) |
HELP!!! Connecting to Oracle 9i - El Forum - 11-04-2009 [eluser]mhel_dc[/eluser] Code: I'm using CI 1.7.2 and I'm trying to connect to Oracle 9i server I've added new database information for oracle since my default database is MySQL: HELP!!! Connecting to Oracle 9i - El Forum - 11-04-2009 [eluser]umefarooq[/eluser] Hi i never tried oracle with ci but i just googled after reading you problem found some links may be useful for you http://techxplorer.com/2008/11/03/using-codeigniter-with-an-oracle-database/ http://www.outofrepose.com/2008/10/10/codeigniter-and-oracle/ HELP!!! Connecting to Oracle 9i - El Forum - 11-04-2009 [eluser]Unknown[/eluser] in database.php change : $active_group = "default"; to $active_group = "ora9"; or $active_group = "default"; $active_record = TRUE; $db['default']['hostname'] = "//hostname/SID"; $db['default']['username'] = "orauser"; $db['default']['password'] = "orapwd"; $db['default']['database'] = ""; $db['default']['dbdriver'] = "oci8"; $db['default']['dbprefix'] = ""; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ""; $db['default']['char_set'] = "utf8"; $db['default']['dbcollat'] = "utf8_general_ci"; Good Luck! HELP!!! Connecting to Oracle 9i - El Forum - 11-04-2009 [eluser]mhel_dc[/eluser] [quote author="bayuan" date="1257398355"]in database.php change : $active_group = "default"; to $active_group = "ora9"; or $active_group = "default"; $active_record = TRUE; $db['default']['hostname'] = "//hostname/SID"; $db['default']['username'] = "orauser"; $db['default']['password'] = "orapwd"; $db['default']['database'] = ""; $db['default']['dbdriver'] = "oci8"; $db['default']['dbprefix'] = ""; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ""; $db['default']['char_set'] = "utf8"; $db['default']['dbcollat'] = "utf8_general_ci"; Good Luck![/quote] I don't want to change the current profile for my default connection since my web application basically connects to MySQL it happens that some of the data is stored in oracle, so I've created another database connection profile ... by default the web application is running under MySQL... I just want to connect to oracle when needed... or if possible simultaneous connection between MySQL and Oracle. HELP!!! Connecting to Oracle 9i - El Forum - 12-15-2009 [eluser]Serebrennikov N. Nick[/eluser] keep in mind, that by default, CI's oracle driver does not use configured in config/database.php encoding, so here's a quick hack: modify file "\system\database\drivers\oci8\oci8_driver.php" function db_connect() { return @ocilogon($this->username, $this->password, $this->hostname, 'AL32UTF8'); } 'AL32UTF8' -is the utf encoding. this is solution may help you, when you are connecting to oracle with windows-1251 encoding HELP!!! Connecting to Oracle 9i - El Forum - 12-15-2009 [eluser]Serebrennikov N. Nick[/eluser] [quote author="mhel_dc" date="1257406522"] I don't want to change the current profile for my default connection since my web application basically connects to MySQL it happens that some of the data is stored in oracle, so I've created another database connection profile ... by default the web application is running under MySQL... I just want to connect to oracle when needed... or if possible simultaneous connection between MySQL and Oracle.[/quote] From CI docs : ---------------------- Connecting to Multiple Databases If you need to connect to more than one database simultaneously you can do so as follows: $DB1 = $this->load->database('group_one', TRUE); $DB2 = $this->load->database('group_two', TRUE); Note: Change the words "group_one" and "group_two" to the specific group names you are connecting to (or you can pass the connection values as indicated above). By setting the second parameter to TRUE (boolean) the function will return the database object. When you connect this way, you will use your object name to issue commands rather than the syntax used throughout this guide. In other words, rather than issuing commands with: $this->db->query(); $this->db->result(); etc... You will instead use: $DB1->query(); $DB1->result(); etc... HELP!!! Connecting to Oracle 9i - El Forum - 12-15-2009 [eluser]helmutbjorg[/eluser] You have made a simple mistake Code: $db['default']['hostname'] = "localhost"; change to Code: $db['default']['hostname'] = "localhost"; You still want the settings inside the $db array. There is no need to change it to $ora. |