As you work with java I suggest you to use Hiberante.
To connect to microsoft sql server 2005 you just need an appropriate jdbc-driver.
NHiberante is for programming with .NET, here's an article on wikipedia which compares between Java and .NET
http://en.wikipedia.org/wiki/Comparison_of_the_Java_and_.NET_platformsHere a sample persistence.xml file I use (I use JPA-approach and SQLServer2008),
it should be easy to adapt for usage in configuration.xml
Code:
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
<persistence-unit name="bclayer">
<properties>
<!-- Scan for annotated classes and Hibernate mapping XML files -->
<property name="hibernate.archive.autodetection" value="class, hbm"/>
<!-- SQL stdout logging -->
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="true"/>
<property name="use_sql_comments" value="true"/>
<!-- MS_SQLServer -->
<property name="hibernate.connection.driver_class" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="hibernate.connection.url" value="jdbc:sqlserver://mymachine:1433;databasename=Bart"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value="mypasswd"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<!-- uncomment following section if you want to go on SQLServer with JTDS (http://jtds.sourceforge.net/) instead
<property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://mymachine:1433;databasename=Bart;cacheMetaData=true;maxStatements=2147483647"/>
-->
<!-- activate following line for logging or profiling (java -jar libext/jdbc/p6spy/sqlprofiler.jar )
all jdbc-activities. Edit spy.properties first (must be located in classpath)
<property name="hibernate.connection.driver_class" value="com.p6spy.engine.spy.P6SpyDriver"/>
-->
</properties>
</persistence-unit>
</persistence>