Hi
I am using hibernate3.jar and sqljdbc.jar for connecting to SQL server 2005. Both the jars are present in my application WEB-INF folder.
In hibernate.cfg.xml, the configuration is as follows:-
Code:
<session-factory>
<property name="connection.useUnicode">true</property>
<property name="connection.characterEncoding">UTF-8</property>
<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="connection.url">jdbc:sqlserver://localhost/test</property>
<property name="connection.username">sa</property>
<property name="connection.password">password</property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="currrent_session_context_class">thread</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<mapping resource="com/nec/cdas/bean/hbm/User.hbm.xml"/>
</session-factory>
When I run the application, not being able to connect to the DB, getting the following error:-
Quote:
opening new JDBC connection
12:05:48,862 WARN SettingsFactory:109 - Could not obtain connection metadata
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.UnknownHostException:
Using the same username/password, I can connect to the DB 'test' using other programs. Where am I wrong?
Thanx,
rash2002