IsthereasimplewaygettingxwikiworkingwithMicrosoftSQLServer

Last modified by Vincent Massol on 2007/11/11

Question Is there a (simple) way to get xwiki working with Microsoft SQL Server Database?
Answer The following works with Microsoft SQL Server 2005 Please note! This has not been tested by the XWiki team but currently I have not seen any errors or problems.

Add the JTDS JDBC for MSSQL to the directory WEB-INFlib


1) Download JTDS JDBC driver for MSSQL from http://jtds.sourceforge.net 2) Copy the file jtds-1.2.2.jar to the directory WEB-INFlib

Create a hibernate-mapping file for MSSQL (xwiki.mssql.hbm.xml)


The xwiki-core-x.x.x.jar file is located in WEB-INFlib

1) In the root of the xwiki-core-x.x.x.jar file locate the hibernate-mapping file for derby (xwiki.derby.hbm.xml) 2) Create a copy of the file xwiki.derby.hbm.xml name it xwiki.mssql.hbm.xml 3) In the new file xwiki.mssql.htm.xml search and replace the following sql-type="BLOB" --> sql-type="VARBINARY(MAX)" sql-type="CLOB" --> sql-type="VARCHAR(MAX)" 4) Make sure that the new file xwiki.mssql.hbm.xml is added to the root of the xwiki-core-x.x.x.jar

Change the file hibernate.cfg.xml


The hibernate.cfg.xml file is located in WEB-INF

Add the following to the hibernate.cfg.xml, making sure adding the required changes for sqlserver, username and password.

jdbc:jtds:sqlserver://127.0.0.1:1577/XWiki sa password net.sourceforge.jtds.jdbc.Driver org.hibernate.dialect.SQLServerDialect com.xpn.xwiki.store.DBCPConnectionProvider 2 2

Create the XWiki database in your SQL Server


Using the SQL Server Administration Interface create a database named XWiki.

Tags:
Created by Tobias Froemel on 2007/01/16
   

Get Connected