title: Connecting to MS SQL Server 2005 via Hibernate
body: <p>I have JRE 1.6 and am using the following hibernate.cfg.xml file. I am always getting "Cannot open connection" and "The port number 1433/DB is not valid."</p>
  
  <pre><code>&lt;hibernate-configuration&gt;
    &lt;session-factory&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://IP/DB&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;&lt;/property&gt;
      &lt;property name="hibernate.connection.pool_size"&gt;10&lt;/property&gt;
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
      &lt;property name="dialect"&gt;org.hibernate.dialect.SQLServerDialect&lt;/property&gt;
      &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;
    &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>