-->
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.  [ 4 posts ] 
Author Message
 Post subject: the network adapter could not establish the connection
PostPosted: Fri Aug 26, 2011 7:21 am 
Newbie

Joined: Fri Aug 26, 2011 7:14 am
Posts: 3
Iam trying to connect hiberante with oracle 10g
Iam using Oracle 10g express edition.

<hibernate-configuration>

<session-factory>

<!-- Database connection settings -->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbcracle:thin:@localhost:1525:xe</property>
<property name="connection.username">user</property>
<property name="connection.password">password</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.OracleDialect</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">create</property>

<mapping class="org.hibernate.example.dto.EmployeeDetails"/>

</session-factory>

</hibernate-configuration>


I can able to connect to database separately.while connecting using hiberate,iam getting " java.sql.SQLException: Io exception: The Network Adapter could not establish the connection" error.Please help.


Top
 Profile  
 
 Post subject: Re: the network adapter could not establish the connection
PostPosted: Fri Aug 26, 2011 8:17 am 
Regular
Regular

Joined: Thu May 07, 2009 5:56 am
Posts: 94
Location: Toulouse, France
Quote:
jdbcracle:thin:@localhost:1525:xe


did you correctly check your JDBC URL?
the proper use in my case is: jdbc:oracle:thin:@localhost:1521:test

_________________
everything should be made as simple as possible, but not simpler (AE)


Top
 Profile  
 
 Post subject: Re: the network adapter could not establish the connection
PostPosted: Fri Aug 26, 2011 9:06 am 
Newbie

Joined: Fri Aug 26, 2011 7:14 am
Posts: 3
[code][/code]

<property name="connection.url">jdbc:oracle:thin:@localhost:1525:xe</property>

This is the URL i used.I am getting the error.

Exception in thread "main" org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
at org.hibernate.example.dto.TestEmployee.main(TestEmployee.java:25)
Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection


Top
 Profile  
 
 Post subject: Re: the network adapter could not establish the connection
PostPosted: Fri Aug 26, 2011 9:12 am 
Newbie

Joined: Fri Aug 26, 2011 7:14 am
Posts: 3
My silly mistake.used wrong port number.


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