Microsoft SQL Server

Top  Previous  Next

This manual assumes you already have Microsoft SQL Server 2000 (v8.0), 2005, or 2008 installed and running.

Note: SQL Server is only supported in Code Collaborator and is not supported by Code Reviewer.  For a complete list of differences between the two products, please see the comparison page.

Instructions for Microsoft SQL Server 2008 and alternate JDBC drivers

There are a number of different JDBC drivers that can be used for SQL Server - no single driver supports all the versions of SQL Server that Code Collaborator supports.  You should refer to the SQL Server Developer Center documentation for specific details about your database installation.

We ship with a driver that is compatible with many configurations, but not SQL Server 2008.  The following drivers can be installed and used in place of the shipped driver:

This driver supports SQL Server 2000, 2005 and 2008 running Java 1.4 or later:

       Microsoft SQL Server JDBC Driver 1.2 Download

This driver supports SQL Server 2000, 2005 and 2008 running Java 5.0 or later:

       Microsoft SQL Server JDBC Driver 2.0 EULA and Download

To install one of these drivers, or other JDBC driver:

1.Download the preferred driver.
2.Stop the Code Collaborator server, if it is running.
3.Go to the following location:  Code Collaborator installation directory/tomcat/lib
4.Replace the sqljdbc.jar in that directory with one just downloaded.
5.Start the Code Collaborator server.

SQL Server 2008 running with Java 6.0

There are additional JDBC driver component files required for SQL Server 2008 support on Java 6.0, and for backward compatibility issues.  The Microsoft 2.0 driver referenced above provides a different .jar file for Java 6.0 installations.  The driver contains two .jar files: sqljdbc.jar and sqljdbc4.jar.  Only sqljdbc4.jar will work on Java 6.0. To install the driver, delete any existing sqljdbc.jar file, and copy the sqljdbc4.jar into the lib directory. Please refer to the SQL Server 2008 JDBC driver documentation for details:

       JDBC Driver Requirements on SQL Server 2008

Setting up the database

Create a database for Code Collaborator. It is recommended that you also create a username/password pair just for Code Collaborator and give this account full access to the database and no access to other databases. You should use a SQL Server account instead of Windows-based authentication because the Code Collaborator service might not be running under a normal Windows-based login.

During the GUI installation screens for the Code Collaborator server, you will be prompted for the SQL Server host name, TCP/IP port, database name, user name, and password. The installer will report any connectivity errors. When you visit the web page for Code Collaborator, it will detect that you have a new database and will create all tables, indexes, and views for you automatically.

SQL Server using integrated authentication

If you are using integrated authentication, there are a couple of additional steps you may need to follow to get Code Collaborator talking to your database.

1)After downloading the necessary drivers from the links above, extract the files.
2)Copy the platform-specific sqljdbc_auth.dll' to the tomcat subdirectory of your  Code Collaborator install.
3)Go to '.../tomcat/conf/Catalina/localhost/ROOT.xml', and add the following to the end of the JDBC "url": ';IntegratedSecurity=true;'
4)Restart the Code Collaborator service.

SQL Server limitations

With SQL Server 2000, text fields can contain a maximum 8000 characters. This includes changelist descriptions, review overview text, and comment and defect text. With SQL Server 2005 and later there is no such restriction.

Troubleshooting

1)If you get the error "The TCP/IP connection to the host has failed. java.net.UnknownHostException", you probably need to enable TCP/IP for your database.  By default SQL Server has the TCP/IP protocol disabled.  Code Collaborator needs this option enabled in order to access your database.  Open the SQL Server Configuration Manager and navigate to "Network Configuration" -> "Protocols".  Make sure TCP/IP is enabled.  By default, SQL Server is configured to use dynamic ports, which means that the port used is changed each time the service is restarted. To use static ports instead open properties for "TCP/IP" and change the "IPAll" settings. Set "TCP Dynamic Ports" to blank and "TCP Port" to the port number you want to use.
2)By default, when Code Collaborator is installed, the service runs as the Local System account.  This means, if you are using integrated authentication, the Local System account must have the permissions necessary to communicate with the database.  Seeing an error such as "Error: Login failed for user 'somedomain\someuser$'." may imply that the local system does not have those permissions.  To handle this situation, you can either grant your Local System account permissions to your database server, or edit the account the Code Collaborator service is using.  To edit the account:
a)From the Administrative Tools menu, open Services.
b)Find ccollab-server in the service list and stop the service.
c)Right-click on ccollab-server, and choose Properties.
d)Go to the Log On tab.
e)Select the "This account" radio button and provide the account information with which you want the Code Collaborator service to operate.
f)Click Apply.
g)Start the ccollab-server service.
3)If you are using SQL Server with named instances, it is important to know your port configuration.  By default, named instances use dynamic ports.  This means, every time SQL Server is restarted, it will search for available ports and assign one to your database.  In this situation, you might have trouble finding the port upon which your database is running and could see errors when trying to connect to your database with Code Collaborator.  If you are using named instances with dynamic ports, do not specify a port when providing Code Collaborator your SQL Server connection information.  By leaving the port unspecified, a request will be sent to your SQL Server instance on port 1434 that will search for the port your database is running on and will then send that information back to Code Collaborator.