Microsoft and Oracle announced a wide-ranging partnership deal in late June. At first glance, the logic behind it was fairly baffling.The agreement lets Oracle customers run its software\u2014including Java, Oracle Database and WebLogic Server\u2014on Microsoft's Hyper-V hypervisor, in its Azure cloud or on Windows Server. The Oracle software will be certified to run on Microsoft platforms, meaning both companies will work to fix any problems that might arise.Microsoft, for its part, will offer a fully licensed version of Java, as well as development tools and Oracle Linux in Azure.The deal was difficult to understand because the two companies compete in the enterprise database marketplace. Why would Microsoft welcome Oracle's database into its Azure cloud to compete with its own SQL Azure? And why would Oracle want to undermine its own Oracle Cloud by encouraging Microsoft to offer Oracle software on Azure?Oracle Needs to Put Its Head in Public CloudTo get to grips with what's going on, it's important to understand that Oracle Cloud is weak and getting weaker by the month, says James Staten, a principal analyst at Forrester Research. "The company's public cloud offering has really had very little success, so Oracle really needs to find another way to get its software into the cloud."Amazon already resells Oracle technologies on its Amazon Web Services cloud platform, so it makes sense to look at Azure as well, Staten says."Oracle can't just stop at Amazon. Azure is the No. 2 public cloud and it is growing, so it is absolutely in Oracle's interest to get its technology onto it," he points out, adding that Oracle can still say that its technologies run best on Oracle Cloud to preserve its dignity.Ellison: Ellison: Oracle Will Deliver World's 'Most Comprehensive Cloud'Holger Mueller, principal analyst at Constellation Research, agrees that Oracle's motivation for the deal is to make its technology available beyond its own public cloud offering. "Oracle is getting its database onto the public cloud provider of the future," he says. "This is a major coup, as now Google is the only major public cloud that doesn't support Oracle."Microsoft Needs Java (Hold the Cream and Sugar)What does Microsoft get out of the deal? Mueller believes Redmond has been very keen to get access to Java. "Amazon's AWS cloud gets developer support because it offers Java, and Microsoft is desperate to do the same," he says. "It wants to become the No. 1 IaaS vendor, but if it has no support for Java, then that becomes almost impossible."In the past, Microsoft has supported Java on its Azure platform, but customers have had to "bring their own" Java\u2014and their own license for it. To be able to have Java set up and ready to go on Azure, along with all the necessary tools, Microsoft needed its own Java license.When Sun owned Java, Staten says, it didn't want to license it to Microsoft because it didn't want to make Windows stronger. By putting Oracle's database on Azure, Microsoft has found a way to get a Java license from Java's new owner.Where does that leave Microsoft's SQL database? Staten points out that, since Azure is positioned as Windows in the cloud, any software that runs on premises should also be able to run on Azure. "This deal means that no one is forced to give up Oracle if they want to run their applications in the Azure cloud," he says.Related: Microsoft Bulks Up Azure, Makes it Easier to Build, Expand Cloud ServicesIn any case, SQL isn't seen as a direct alternative to the more powerful and scalable Oracle database by most organizations, Staten says. "But for Microsoft, at least Oracle customers may be exposed to SQL Azure or SQL running in a VM as a consequence of this deal."The partnership is also good for Microsoft because it's exclusive: You can virtualize Oracle software only in an Oracle VM or using Microsoft's virtualization technology. There's no technical reason why Oracle can't run on a VMware hypervisor, but that company has effectively been left out in the cold. "Oracle appears to be betting against VMware becoming a leader in the public cloud space," Staten says.Everyone's a WinnerAs for the known details of the deal, Microsoft will likely have to pay Oracle a significant sum for the Java license. In financial terms, then, Oracle would seem to be the main beneficiary of the deal in the short term. Oracle also benefits by ensuring that its technologies can be used in what one day may be the biggest public cloud.Looking further, though, Microsoft may be the bigger winner. That's because Azure and Hyper-V gain a great deal of credibility from being certified platforms for Java and Oracle's database. It puts Microsoft Azure on nearly equal footing with AWS and definitely gives it an advantage over VMware's public cloud efforts.But perhaps the biggest beneficiaries will be Microsoft's and Oracle's enterprise customers. The deal makes Azure a more competitive platform for them, as Oracle software is now fully supported in Microsoft's cloud. Previously customers would have had to have gone to AWS for that kind of support. Plus, increased competition is invariably good for business.Paul Rubens is a technology journalist based in England. Follow everything from CIO.com on Twitter @CIOonline, Facebook, Google + and LinkedIn.