Hibernate connection works well with local postgresql and it automatically creates tables, but when we want to use Azure SQL Server (Microsoft SQL Server) and we change driver name etc., we didn't get any error but it didn't work. (didn't create tables)
jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.databaseurl=jdbc:sqlserver://xxxx.database.windows.net:1433;database=xxxx
jdbc.password=xxxx
jdbc.user=xxx@xxxx
jdbc.encrypt=true
jdbc.hostNameInCertificate=*.database.windows.net
jdbc.loginTimeout=30;
jdbc.dialect=org.hibernate.dialect.SQLServerDialect
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/jdbc.properties" >
</bean>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.databaseurl}" p:username="${jdbc.user}"
p:password="${jdbc.password}">
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan">
<list>
<value>com.xxx.entity</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${jdbc.dialect}</prop>
<prop key="hibernate.c3p0.min_size">5</prop>
<prop key="hibernate.c3p0.max_size">20</prop>
<prop key="hibernate.c3p0.idle_test_period">60</prop>
<prop key="hibernate.c3p0.max_statements">100</prop>
<!--<prop key="hibernate.hbm2ddl.auto">${database.hbm2ddl.auto}</prop>-->
<!--<prop key="hibernate.show_sql">${database.show_sql}</prop>-->
<!--<prop key="hibernate.format_sql">${database.format_sql}</prop>-->
</props>
</property>
</bean>