Wiki source code of MSSQL Installation

Version 5.1 by Helmut Nagy on 2008/04/04

Show last authors
1 1 Microsoft SQL Server Installation
2
3 #info("This has been tested only on MSSQL 2000. MSSQL 2005 will probably not work due to the depreciation of the text types.")
4
5 #warning("Case-insensitive search does not work with this database; see below for more info. You may want to use the the [Lucene search>code:Applications.SearchApplication]")
6
7 1.1 Create the xwiki user and database
8
9 * Use the Enterprise Manager to create a database named 'XWiki' and a user named 'xwiki'.
10 * Set xwiki's password to 'xwiki'.
11 * Give database ownership of the database XWiki to the user xwiki.
12
13 1.1 Install the JDBC driver
14
15 * Download the [jtds jdbc driver>http://jtds.sourceforge.net/] and install the jar file into your servers lib directory (for JBoss this could be ~~server\\\default\\\lib\\\~~, for Tomcat this might be ~~common\\\lib\\\~~)\\
16
17 #info("The connection was successfully tested with version 1.2.1 of the driver and version 1.3.1 of XWiki. Some problems occurred when using drivers > 1.2.1 so it might be better to use the old one. ")
18
19 * Alternatively, you can use the [JDBC driver provided by Microsoft>http://www.microsoft.com/downloads/details.aspx?familyid=07287B11-0502-461A-B138-2AA54BFDC03A&displaylang=en], however this has not been tested.
20
21 1.1 When compiling from source
22
23 * Add {attach:xwiki.mssql.hbm.sql|xwiki.mssql.hbm.xml} to ~~xwiki-core\\\src\\\main\\\resources\\\~~ and recompile everything.
24
25 1.1 When using a downloaded .war
26
27 * Save the file {attach:xwiki.mssql.hbm.sql|xwiki.mssql.hbm.xml} as ~~WEB-INF/classes/xwiki.mssql.hbm.xml~~ (creating the ~~classes~~ directory if needed). This directory can be found inside the XWiki war, which is either a directory or a zip file.
28
29 1.1 XWiki configuration
30
31 * Tell XWiki to use MSSQL. To do this, edit the ~~WEB-INF/hibernate.cfg.xml~~ file. Replace the matching properties with the following ones (or uncomment them if they are present):
32
33 {code:none}
34 <property name="connection.url">jdbc:jtds:sqlserver://<server-url>:1433/XWiki;tds=8.0;lastupdatecount=true</property>
35 <property name="connection.username">xwiki</property>
36 <property name="connection.password">xwiki</property>
37 <property name="connection.driver_class ">net.sourceforge.jtds.jdbc.Driver</property>
38 <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
39 <property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
40 <property name="connection.pool_size">2</property>
41 <property name="statement_cache.size">2</property>
42 <mapping resource="xwiki.mssql.hbm.xml"/>
43 <mapping resource="feeds.hbm.xml"/>
44
45 {code}
46
47
48 1.1 Fix search function
49
50 If you try to do a search, via [Main.WebSearch], you will get an error. This is because the UPPER() function doesn not work on TEXT or NTEXT as used by MSSQL 2000 for blobs. The only solution I have found is to remove all the calls to upper() in [Main.WebSearch]. This is however not very practical, because it makes search case&#45;sensitive.
51
52 Alternatively, you may want to use the [Lucene search>code:Applications.SearchApplication] instead of the default search.

Get Connected