Is it possible to embed a MySQL database server into a Java servlet?

I am in a situation where I am being asked to make a single WAR file that runs WordPress. Using Quercus, Tomcat and httpd+mod_rewrite I was able to make a WAR file containing everything except the database, which I ran externally. However, I’m not sure how I might go about removing the dependency upon an external database (and, frankly, this whole endeavor seems like a bad idea to me).

This article describes how WordPress has been successfully deployed on the Google App Engine and hence without needing MySQL, but this was done using JPA.

Read More

Instead of embedding a MySQL instance, if I could use an external MSSQL database connection instead that would be fine too. (This is an old post, but it seems to suggest that real MySQL is the only supported database for WordPress.) Is the most viable option to attempt to replace each MySQL call in the WordPress source code to a MSSQL call? Is there some kind of compatibility/translation layer that I could use instead? (I saw this question, but the solution will not work in my case.)

UPDATE: I came across MySQL-JE, but it looks out of date and not quite complete enough (not sure how I would tell Quercus/PHP to communicate with it). Has anyone used it? If so, do you think it would help solve this problem?

Related posts

Leave a Reply

1 comment

  1. Embedded Database

    According to this chart, MySQL is not built for embedded use.

    I can point you to two pure Java database engines for embedding in a Java app. Both are open-source, free of cost, and under active development. Both have a good pedigree with a long line of database development history behind them.

    WordPress Requires MySQL

    According to this WordPress Requirements page, specifically MySQL is required. That’s annoying. The main point of SQL is to avoid database-vendor lock-in.