5

I have a very simple question. We have an IBM UniVerse server and I want to connect to it through PHP in the same manner that I use to connect to MySQL. I do not know any other information (server version, age, etc). All I know is that it runs on a *NIX OS.

Can somebody point to me to a starting point? Are there drivers I can use (libraries for PHP?)? Do I need to find out more information (it will be tough but i can try).

Thank you for all the support.

AC

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
achilles
  • 119
  • 1
  • 9
  • If you are running "IBM" UniVerse, you might want to look into upgrading since the UniVerse product has been owned by Rocket Software since the end of 2009. Visit www.rocketsoftware.com/u2 – Dan McGrath Feb 10 '12 at 15:35

3 Answers3

0

You may try this to connect to a UniVerse server, but I'm not sure what you mean same manner that you use to connect to MySql, since UniVerse is a lot different from MySql.

If you want to use SQL command like SELECT/INSERT/UPDATE, I think ODBC is what you looking for.

<?php
   $UOSession = new COM("UniObjects.unioaifctrl");
   $UOSession->HostName = "localhost";
   $UOSession->AccountPath = "ACC.NAME";
   $UOSession->DatabaseType = 1;
   $UOSession->UserName = "username";
   $UOSession->Password = "password";
   $UOSession->Connect;
   if ($UOSession->IsActive) {
       // process
   }
   
   $UOSession->Disconnect;
   $UOSession = null;
?>
ruby.lee
  • 107
  • 8
0

The easiest way to do this would be to use the ODBC driver.

You can use PDO with ODBC drivers, or you can use the ODBC classes directly. I recommend PDO, as having that extra layer of abstraction is good in case you need to switch to a different database in the future.

Brad
  • 159,648
  • 54
  • 349
  • 530
0

As said by Brad, if you want SQL access you can use ODBC to connect. Note that UniVerse is not a SQL database so when accessing it via ODBC you might have to do some setup work on the server. You might want to read some of the manuals.

Alternatively, Rocket Software have now released a RESTful Web Services product (free to download as part of the U2 DBTools package) that allows you to access the database in the manner instead.

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
  • Dan are you sure the Web services package operates with older versions of Universe? Have just looked into a similar issue with UV10.2 and the new net drivers do not work, we had to resort to the now depreciated uonet APIs. – ScaryMinds Apr 29 '18 at 23:47
  • It's been so long I honestly cannot remember. 10.2 is an extremely old version (it was EOM'd in 2010 and EOL'd om 2017. Given that, I think deprecated UONet is the least of your concerns. My strong advice would be to contact Rocket or your ISV to upgrade to at least 11.2, if not 11.3. – Dan McGrath Apr 30 '18 at 16:11