-->
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.  [ 7 posts ] 
Author Message
 Post subject: how to resolve cannot open connection error???
PostPosted: Wed Jan 18, 2006 1:56 pm 
Beginner
Beginner

Joined: Thu Jan 12, 2006 7:38 pm
Posts: 25
HI I configured oracle with hibernate. using hibernate.cfg.xml

<property name="hibernate.connection.provider_class">org.hibernate.connection.DriverManagerConnectionProvider</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@host:1521:databasename</property>
<property name="connection.username">test</property>
<property name="connection.password">test</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">10</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>


i am getting exception called Cannot open connection

I dont know why??

please let me know.

regards
Gopal


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 2:19 pm 
Beginner
Beginner

Joined: Mon Mar 14, 2005 6:07 pm
Posts: 36
Did you forget to replace the host:1521:databasename part with the names of your host and your database? I found it really useful to first try connecting to Oracle using SQLPlus, then copying the connection parameters into the configuration file.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 2:28 pm 
Beginner
Beginner

Joined: Thu Jan 12, 2006 7:38 pm
Posts: 25
no i given correct database, post and host name.

and i copied classes12.jar in my lib directory also.

when i executes it shows
Could not obtain connection metadata
Connection refused(DESCRIPTION=(TMP=)(VSNNUM=135296000)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
SQL Error: 17002, SQLState: null

i dont know why??


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 2:39 pm 
Beginner
Beginner

Joined: Mon Mar 14, 2005 6:07 pm
Posts: 36
One case I know when this may hapen is when you have an oracle JDBC driver incompatible with the oracle server (the error code 17002 points to the possibility of this problem). Please verify that the driver in your class path match your server installation. For example, if you are running 10i/g etc., you need ojdbc14.jar, not classes12.jar.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 2:51 pm 
Beginner
Beginner

Joined: Thu Jan 12, 2006 7:38 pm
Posts: 25
i am using oracle 9 only.

did i miss anything in config file.

i added classes12.jar in my project/webcontent/webinf/lib folder.

is that fine??

prevoiusly i was using hsqldb it was working fine, now i want to connect oracle.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 3:05 pm 
Beginner
Beginner

Joined: Mon Mar 14, 2005 6:07 pm
Posts: 36
What's your JDK? If it's 1.4+, you need to switch to ojdbc14.jar even if you are using oracle 8 and 9. You can get them from here: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 3:06 pm 
Beginner
Beginner

Joined: Mon Mar 14, 2005 6:07 pm
Posts: 36
One case I know when this may hapen is when you have an oracle JDBC driver incompatible with the oracle server (the error code 17002 points to the possibility of this problem). Please verify that the driver in your class path match your server installation. For example, if you are running 10i/g etc., you need ojdbc14.jar, not classes12.jar.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.