title: Hibernate Authentication Error with SQL Server
body: <p>I am having a difficult time trying to set a connection with hibernate to a SQL Server. I should create a connection to the following data source DataSource=server,port. It seem strange that the port must be specify with a comma instead of :</p>
  
  <p>When I connect to it through Visual Studio 2012 this is how it looks:</p>
  
  <p>Data Source=server,17001;Initial Catalog=database;User ID=username</p>
  
  <p>In order to connect it I create the following hibernate configuration file:</p>
  
  <pre><code>&lt;hibernate-configuration&gt;
   &lt;session-factory name=""&gt;
    &lt;property name="hibernate.connection.driver_class"&gt;com.microsoft.sqlserver.jdbc.SQLServerDriver&lt;/property&gt;
    &lt;property name="hibernate.connection.url"&gt;jdbc:sqlserver://server.fqdn&lt;/property&gt;
    &lt;property name="hibernate.connection.port"&gt;port&lt;/property&gt;
    &lt;property name="hibernate.connection.username"&gt;username&lt;/property&gt;
    &lt;property name="hibernate.connection.password"&gt;password&lt;/property&gt;
    &lt;property name="hibernate.connection.databasename"&gt;database&lt;/property&gt;
    &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.SQLServerDialect&lt;/property&gt;
    &lt;property name="hibernate.enable_lazy_load_no_trans"&gt;true&lt;/property&gt;
    &lt;property name="connection.pool_size"&gt;1000&lt;/property&gt;
   &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>But I get the following Exception when the connection is attempted:</p>
  
  <p>Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'username'. ClientConnectionId:c619c1dc-2c6c-4c6e-bc81-7d3619ee9ff1</p>
  
  <p>I know for sure that the user and password are correct as I am using them to connect to the database through Visual Studio 2012 and they works fine.
  Any idea of how should I face it?</p>