-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Oracle 10g. Could not obtain connection metadata.
PostPosted: Thu Jun 18, 2009 5:21 am 
Newbie

Joined: Wed Jun 17, 2009 1:18 pm
Posts: 2
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>


Top
 Profile  
 
 Post subject: Re: Oracle 10g. Could not obtain connection metadata.
PostPosted: Thu Jun 18, 2009 6:30 am 
Senior
Senior

Joined: Tue Oct 28, 2008 10:39 am
Posts: 196
Did you try jdbc:oracle:thin:@IP:Port:Instance? Are you sure your port is 5021?


Top
 Profile  
 
 Post subject: Re: Oracle 10g. Could not obtain connection metadata.
PostPosted: Thu Jun 18, 2009 10:19 am 
Newbie

Joined: Wed Jun 17, 2009 1:18 pm
Posts: 2
:-8
Extremely sorry, mate...
i used the wrong port.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.