Show last authors
1 1 Microsoft SQL Server Installation
3 #info("This has been tested on MSSQL 2000 and MSSQL 2005 (text types are only deprecated in MSSQL 2005, this tutorial won't work when they'll be dropped)")
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>extensions:Extension.Search Application]")
7 1.1 Create the xwiki user and database
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.
13 1.1 Install the JDBC driver
15 * Download the [jtds jdbc driver>] 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\\\~~)\\
17 #info("The connection was successfully tested with version 1.2.1 of the driver and version 1.5 of XWiki. Some problems occurred when using drivers > 1.2.1 so it might be better to use the old one. ")
19 * Alternatively, you can use the [JDBC driver provided by Microsoft>], however this has not been thoroughly tested.
22 1.1 XWiki configuration
24 * 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):
26 {code:xml}
27 <property name="connection.url">jdbc:jtds:sqlserver://<server-url>:1433/XWiki;tds=8.0;lastupdatecount=true</property>
28 <property name="connection.username">xwiki</property>
29 <property name="connection.password">xwiki</property>
30 <property name="connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
31 <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
32 <property name="connection.provider_class"></property>
33 <property name="connection.pool_size">2</property>
34 <property name="statement_cache.size">2</property>
35 <mapping resource="xwiki.mssql.hbm.xml"/>
36 <mapping resource="feeds.hbm.xml"/>
37 <mapping resource="activitystream.hbm.xml"/>
38 {code}
42 1.1 Troubleshooting
44 1.1.1 Fix search function
46 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.
48 Alternatively, you may want to use the [Lucene search>extensions:Extension.Search Application] instead of the default search.
50 1.1.1 Hints for upgrading to MS SQL 2005
52 In MS SQL 2005 the standard schema in all databases is dbo by default. However, if you upgrade your server with the standard Microsoft software, all tables in your xwiki database will be configured to use a schema whichs name is equivalent to the database name. (If your database name is "xwiki", the schema name will also be "xwiki" and the full qualified tablenames will be "xwiki.xwikidoc", and so on)
54 Since the standard schema in is configured to be "dbo", xwiki will not find any tables (since it searches for "dbo.xwikidoc", ...). This will result in an exception when calling the xwiki webapp (in the logfiles you will see an "object not found" - exception for xwikidoc, because xwikidoc is the first table to be mapped via hibernate)\\
55 \\
56 There are 2 possible solutions to this problem:
58 * Reconfigure your server to use "xwiki" as standard scheme inside the xwiki-database.
59 * Adopt the hibernate file (xwiki.mssql.hbm.xml). Look for the table definitions, eg. ~~table="xwikidoc"~~ and set it to ~~table="xwiki.xwikidoc"~~, or to whatever your schema/database is called. Do this for all tables you can find in the file.

Get Connected