More than a decade ago, Google re-implemented the Java programming language as part of its new Android mobile operating system. Oracle, the owner of Java, then sued Google for copyright infringement in 2010. Later this month, the Supreme Court will hear oral arguments in this epic copyright case that will have huge implications for the entire software industry—and that could cost Google billions of dollars.

Google says it has done nothing wrong. Copyright law specifically excludes "systems" and "methods of operation" from copyright protection. Google argues that the aspects of Java it copied—function names, argument types, and so forth—fit squarely into these exceptions. Google also argues that copyright's fair use doctrine allows for this kind of copying.

The case is being closely watched by the software industry. Companies like Microsoft and IBM have warned that Oracle's stance could create chaos for the industry. They argue that making this kind of copying illegal would not only create legal headaches for a lot of software companies—it would be bad for customers, too.

Software companies copy software interfaces—known in industry jargon as application programming interfaces (APIs)—of their competitors' products all the time. This allows competing software products to be interoperable so that a customer can take software designed to work on one platform and re-use it on another. That means lower switching costs for customers. It also means lower barriers for entry for software startups, since it's easier to sell a new product if it's compatible with a software product that customers already know and trust.

If anyone should understand the importance of such copying, it's Oracle. After all, Oracle got its start in the 1970s selling a database product based on the then-new structured query language (SQL). SQL was invented by IBM. And Oracle doesn't seem to have gotten a license to use it.

If Oracle wins its legal battle, one ironic result will be to make the software industry less hospitable to future startups like Oracle. Incumbent software companies would have a greater ability to lock customers into their own proprietary standards. Startups wouldn't be allowed to do what Oracle did four decades ago: make its product compatible with an established competitor, then make that interoperability a selling point.

As I'll explain below, Oracle's copying of SQL seems pretty similar to Google's copying of Java. But an Oracle spokeswoman disagrees. "It’s an incorrect premise, comparing apples with broccoli, and being completely divorced from the facts of the case," she wrote in a Tuesday email.

Oracle got its start copying IBM's software interface

Beginning in the early 1970s, researchers at IBM developed a new approach to database organization known as the relational model. This model made it easier to perform complex queries on a database, and IBM created a new language called structured query language (SQL) to help users formulate these queries. An SQL statement looks something like this: "select customer_name, ship_date from orders where product_id=17 and state='CA'."

There are two things to notice here. First, SQL has a simple, English-like syntax. Someone with no background in programming or database administration can get a rough idea of what this statement does just by reading it. Second, SQL is a declarative language: users specify what information they're looking for, but they leave it up to the database system to decide how to find the information.

Taken together, these characteristics have made SQL particularly accessible to people without formal training in computer programming. With a bit of practice, non-programmers can write SQL queries to accomplish a wide range of tasks.

In 1974, a small group of IBM researchers began implementing these ideas in a software package called System R. Around the same time, IBM's researchers—who saw themselves as computer scientists as much as software developers—published research papers describing their work. These publications went into significant detail, including a complete specification for the SQL language.

IBM had a working version of System R within a few years, but it was never intended to be a commercial product. It wasn't until the early 1980s that IBM finally offered an SQL-based commercial database for sale.

Around 1977, Larry Ellison and his co-founders spotted an opportunity. They had recently started a software consulting company called Software Development Laboratories, but they wanted to transition to selling a software product. Ellison realized there was enough detail in IBM's white papers to clone IBM's database technology. He also realized that it would provide a credibility boost if he could say that their new Oracle database was fully compatible with IBM's SQL standard.

According to one of SQL's designers, Donald Chamberlin, Ellison was so determined to achieve compatibility with IBM's technology that he called Chamberlin in 1978 seeking more details about IBM's implementation of SQL.

Ellison "had heard about the System R prototype and he wanted to make sure that his product was fully compatible with it, right down to the error code values," Chamberlin said in a 1995 interview. Chamberlin says he would have been happy to share more information, but his bosses nixed the idea, declaring error codes to be confidential.

Still, IBM's System R white papers contained plenty of details about how SQL worked. So Ellison and his team pushed forward, releasing the first version of the Oracle database in 1979. And the company repeatedly touted the product's IBM roots.

"Oracle's user interface is SQL, the Relational Data Language developed by IBM Advanced Research," one early Oracle flyer said.

(I got this snapshot from Charles Duan, a researcher at the R Street Institute, a DC think tank that has gotten some funding from Google. Back in January, we published Duan's article pointing out that Oracle copied the API for Amazon's S3 platform—part of Amazon Web Services.)

Getting to market about two years ahead of IBM allowed Oracle to claim significant market share. Oracle would maintain its status as the SQL database leader for years to come.

System R insiders continue to argue about whether it was a mistake for IBM to publish details about SQL. Obviously, it allowed Ellison to beat IBM to market, costing IBM market share. But some insiders believe that the publication of the System R papers was essential to generating enough buzz for IBM to take the technology seriously in the first place.

"If we had not published those papers, it would have failed," IBM veteran Mike Blasgen said in 1995. "IBM would have ignored it."

History repeats itself?

For this story, I read two books about the history of Oracle and read several in-depth interviews with IBM insiders. Oracle does not seem to have even tried to license SQL from IBM, and everyone involved seemed to assume that Oracle didn't need a license.

Google, by contrast, did discuss a licensing deal for Java before ultimately deciding to proceed without one.

When Google started working on Java in the mid-2000s, the technology was owned by Sun Microsystems—Oracle didn't acquire Sun until 2010. In 2005, Google approached Sun about a licensing deal. Google insists that it never tried to license the copyright in Java interfaces, since (in Google's view) the law didn't require it. But Google says the two companies tentatively agreed for Google to pay Sun $28 million to license Java-related patents, the Java trademark, and other assets.

However, Google claims that "negotiations broke down over issues unrelated to money." Google says Sun sought more control over the evolution of the Android platform than Google was willing to offer. So Google decided to build its own version of Java without a license from Sun.

What this meant was that Google started with a functional specification of the Java language—the rules that make Java Java. This included keywords, syntax rules, and the names and argument types of standard functions. But with a few disputed exceptions, Google didn't copy the code that implemented these functions. Like Oracle with SQL, Google engineers wrote their own code, from scratch, that produced the same results as Sun's Java code.

Despite the lack of a licensing deal, Sun CEO Jonathan Schwartz was enthusiastic when Google ultimately announced that Android would be based on Java.

"I just wanted to add my voice to the chorus of others from Sun in offering my heartfelt congratulations to Google on the announcement of their new Java/Linux phone platform, Android," Schwartz wrote.

But the company's tune changed after the Oracle acquisition. As Android adoption soared, Sun's new owners saw the opportunity to get billions of dollars out of Google. Oracle sued Google shortly after its acquisition of Sun closed.