<
From version < 13.1 >
edited by Johannes Stoldt
on 2011/01/17
To version < 14.1 >
edited by Johannes Stoldt
on 2011/01/17
>
Change comment: Added some info on how to use with MSSQL 2008 R2

Summary

Details

Page properties
Content
... ... @@ -16,23 +16,20 @@
16 16  
17 17  == Install the JDBC driver ==
18 18  
19 -* 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
20 -default
21 -lib
22 -//, for Tomcat this might be //common
23 -lib
24 -//)\
19 +* 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\//)
25 25  
26 26  {{info}}
27 27  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.
28 28  {{/info}}
29 29  
30 -* 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 thoroughly tested.
25 +* Alternatively, you can use the [[JDBC driver provided by Microsoft>>http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a737000d-68d0-4531-b65d-da0f2a735707&displaylang=en]], however this has not been thoroughly tested.
31 31  
32 32  == XWiki configuration ==
33 33  
34 34  * 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):
35 35  
31 +=== JTDS ===
32 +
36 36  {{code language="xml"}}
37 37  <property name="connection.url">jdbc:jtds:sqlserver://<server-url>:1433/XWiki;tds=8.0;lastupdatecount=true</property>
38 38  <property name="connection.username">xwiki</property>
... ... @@ -47,6 +47,26 @@
47 47  <mapping resource="activitystream.hbm.xml"/>
48 48  {{/code}}
49 49  
47 +=== MS JDBC driver ===
48 +
49 +{{info}}
50 +Copy sqljdbc.jar from the downloaded package into //\webapps\xwiki\WEB-INF\lib\//. If you have installed Sun JRE 1.6 (or above) you need to copy **sqljdbc4.jar** instead!
51 +{{/info}}
52 +
53 +{{code language="xml"}}
54 +<property name="connection.url">jdbc:sqlserver://localhost:1433;DatabaseName=XWiki</property>
55 +<property name="connection.username">xwiki</property>
56 +<property name="connection.password">xwiki</property>
57 +<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
58 +<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
59 +<property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
60 +<property name="connection.pool_size">2</property>
61 +<property name="statement_cache.size">2</property>
62 +<mapping resource="xwiki.mssql.hbm.xml"/>
63 +<mapping resource="feeds.hbm.xml"/>
64 +<mapping resource="activitystream.hbm.xml"/>
65 +{{/code}}
66 +
50 50  == Troubleshooting ==
51 51  
52 52  === Fix search function ===
... ... @@ -59,7 +59,7 @@
59 59  
60 60  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)
61 61  
62 -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)\ \
79 +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)
63 63  There are 2 possible solutions to this problem:
64 64  
65 65  * Reconfigure your server to use "xwiki" as standard scheme inside the xwiki-database.

Get Connected