View Full Version : Microsoft SQL Server Supported?
07-27-2010, 11:15 PM
Hello everyone. I'm looking to potentially do a Wordpress implementation using Quercus. However, we use Microsoft SQL Server for our database backend. Is Microsoft SQL Server supported by Quercus?
I haven't been able to find anyone who has done this. Has this been done yet? Is it possible?
If it is possible, but has yet to be done, what should I be looking at in order to complete this? I see that Microsoft has a "PHP Driver" for MSSQL Server, and obviously Microsoft has JDBC drivers on the Java side.
Resin certainly supports MS Sql JDBC driver, so it should be possible. You need to configure the datasource used for WordPress with Ms SQL jdbc driver: WEB-INF/resin-web.xml:
Hello, sorry to refresh old thread but I have problem with what alex posted.
I try to connect to MSSQL 2008 R2 database called "test" on my localhost using Quercus/PHP
To the web.xml i added:
In my .php file i have:
$db = new PDO("java:comp/env/jdbc/sqlserver");
And it gives me following error:
Fatal Error: 'java:comp/env/jdbc/sqlserver' is an unknown PDO JNDI data source.
I copied the jtds-1.3.1.jar to the lib folder. Do I need to do anything more to make this work?
If anyone is interested I solved the problem:
Using Tomcat 7, i replaced the jtds driver with MS sqljdbc4 and added to the conf/context.xml following code:
<Resource name="jdbc/sqlserver" auth="Container" type="javax.sql.DataSource" username="username" password="password" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://localhost;databaseName=test"/>
Declaration of <database> in web.xml is now not required. It's maybe not the best solution but it seems to work fine with PDO.
vBulletin® v3.8.6, Copyright ©2000-2017, Jelsoft Enterprises Ltd.