Hi all,
I'm trying to connect to an Oracle 10 g server in a unix machine from windows machine.
I'm able to connect to it using SQL plus and from java using jdbc.
But, when I'm using hibernate, I'm getting the following error:
Could not obtain connection metadata java.sql.SQLException: Io exception: The Network Adapter could not establish the connection at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:335) at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:361) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:442) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:154) at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84) at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2090) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2086) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1311)
The hibernate.cfg.xml file is as follows: [I've tried with machine name alone, full system name including the domain name and with ip address. nothing worked]
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="connection.url">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.21.4.222)(PORT=5021)))(CONNECT_DATA=(SERVICE_NAME=RMSSALES)(SERVER=DEDICATED)))</property> <property name="connection.username">user1</property> <property name="connection.password">password1</property><!--<property name="hibernate.connection.pool_size">50</property>--> <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property> <property name="show_sql">true</property> <property name="hibernate.use_outer_join">true</property> <property name="connection.autocommit">false</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="connection.pool_size">40</property>
|