Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Quercus

Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2010, 11:15 PM
fasslej fasslej is offline
Junior Member
 
Join Date: Jul 2010
Posts: 1
Question Microsoft SQL Server Supported?

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.
Reply With Quote
  #2  
Old 10-11-2010, 06:28 PM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

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:

<database jndi-name="jdbc/blog">
<driver type="net.sourceforge.jtds.jdbc.Driver">
<url>jdbc:jtds:sqlserver://x.x.y.z.:1433/blog</url>
<user>user</user>
<password>pass</password>
</driver>
</database>
Reply With Quote
  #3  
Old 06-19-2013, 07:05 AM
fifi fifi is offline
Junior Member
 
Join Date: Jun 2013
Posts: 2
Default

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:
Code:
<database jndi-name="jdbc/sqlserver">
 <driver type="net.sourceforge.jtds.jdbc.Driver">
 <url>jdbc:jtds:sqlserver://127.0.0.1:1433/test</url>
 <user>myuser</user>
 <password>mypassword</password>
 </driver>
 </database>
In my .php file i have:
PHP Code:
$db = new PDO("java:comp/env/jdbc/sqlserver"); 
And it gives me following error:
Code:
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?
Reply With Quote
  #4  
Old 06-25-2013, 12:33 PM
fifi fifi is offline
Junior Member
 
Join Date: Jun 2013
Posts: 2
Default

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:

Code:
<Context>
<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.
Reply With Quote
Reply

Tags
java, microsoft sql server, php, quercus, wordpress

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:55 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.