From Resin 3.0

Jump to: navigation, search



This article provides some simple steps so that you can access MySQL from a Quercus / PHP page. It assumes that you have already installed MySQL and that it is running on port 3306. It also assumes that you have already installed Resin and can at least get "HelloWorld.php" to run (see: PHP Hello World).

For the purposes of this article, I assume that you are working with Resin 3.0.17 and that the directory housing httpd.exe is c:\resin-3.0.17. I will call this directory %ResinHome%.

Step 1: Download the MySQL jdbc driver

As of this writing (2-Jan-06), you can download the current MySQL connector/J at Copy the the jar into %ResinHome%\lib.

Step 2: Modify %ResinHome%\conf\resin.conf

Open resin.conf in your favorite text editor and find the following section:

Excerpt from resin.conf

      - Sample database pool configuration
      - The JDBC name is java:comp/env/jdbc/test
          <driver type="">

Uncomment the <database> element. For those less comfortable with XML, this means strip out the first 5 lines (from <!-- to -) and the last line (-->).

Step 3: add a <database> element to %ResinHome%\webapps\ROOT\WEB-INF\web.xml


<web-app xmlns="">
  <servlet-mapping url-pattern="*.php"

Now restart httpd.exe


These steps will allow you to use the mysql and the improved mysql modules from within a quercus page.

Personal tools