Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Hibernate Problem with open connection
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


subbu
Problem with open connection
0 Answer(s)      4 years and 4 months ago
Posted in : Hibernate


Hi Team,

I am running one hibernate application and the database is ORACLE 10g.I am getting the below error.I connected to the database by using JDBC(with same driver and url).Please tell me where my mistake is ?

org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:301)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:110)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:137)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:49)
at org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:24)
at org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1079)
at Store.main(Store.java:27)
Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:210)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:298)
... 7 more


and my Hibernate.hbm.xml file is:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin://localhost:1522/xe></property>
<property name="hibernate.connection.username">hr</property>
<property name="hibernate.connection.password">subbu</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<!-- Mapping files -->
<mapping resource="xxx.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
Problem with open connection - Hibernate
Problem with open connection  Hi Team, I am running one... open connection... Adapter could not establish the connection
problem in jdbc connection
problem in jdbc connection  when i am trying to insert into apache derby databse using java in netbeans an exceprion is thrown at run time like this:- java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver....what
Advertisements
open a connection to a database with exclusive mode with JDBC
open a connection to a database with exclusive mode with JDBC  Is possible to open a connection to a database with exclusive mode with JDBC
open a connection to a database with exclusive mode with JDBC
open a connection to a database with exclusive mode with JDBC  Is possible to open a connection to a database with exclusive mode with JDBC
how to solve an internet connection problem
how to solve an internet connection problem  when i run my application it give me this error: Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not yet implemented the problem is that i don`t know
Correctly Open and Close database connection
; } Completely Open and Close A Database Connection Database Connection... depends on database connectivity. Therefore it is very important to open and close database connections properly. If any database connection is open
java oracle connection problem - SQL
java oracle connection problem  I have successfully made connection with the oracle10g database that i am using and also able to put in data using JSP. But the codes that i have tried for fetching the data are not working even
Open Jgraph Problem - Java Beginners
Open Jgraph Problem  Hi, I have go through the example given in http://sourceforge.net/projects/openjgraph/ for Open Jgraph by Jesus M. Salvo Jr. I have amended one of the sample (SampleTreeLayout.java) codes as below
Problem to get connection from DAO class to JDBC
Problem to get connection from DAO class to JDBC  package controller... ConnectionProvider { private static Connection con=null; //static Connection..."); }catch(Exception e){} } public static Connection getCon(){ return con
Connection
Connection  What is Connection
connection
connection   how to make multiple database connection using jdbc
connection
the connection with the available port on the host machine: import java.net.... the connection was not established. Predict the output of the preceding code. Explain why the connection cannot be established
please help me solve this problem when i am create database connection using servlecontext
please help me solve this problem when i am create database connection using servlecontext  hi... I have create a database connection using... understand what is the problem .... the code are as follows. the servlet context
Connection pooling
connection with every request. Connection pool manager maintains a pool of open...Connection pooling  hii, What is Connection pooling?   hello, Connection pooling is a technique used for sharing server resources among
connection - JNDI
connection   Hi, i am getting this error,can any one know pls give... a connection, pool exhausted  Hi friend, Plz give full details with source code to solve the problem : Thanks
Connection pooling
Connection pooling  What is Connection pooling
Open or Open Source Software
Open or Open Source Software  what is mean by open or open source software in Computer Terminology?   In a computer terminology, open or open source software means any technology or a software that are freely available
connection closing
connection closing  hello, what happens if connection is not closed
Connection to Database
database tables? Do I need to open one connection to each section? Thank you...Connection to Database  Hello, I have a website with more than 50.... However, most of times my web pages displays the error message" Too many Connection
Problem
) { System.err.println("Couldn't get I/O for " + "the connection to: sunil-PC."+ e... with no errors, but when running giving "java.net.connectexception connection
Java jdbc connection
Java jdbc connection  Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection
Problem
for " + "the connection to: sunil-PC."+ e); System.exit(1... "java.net.connectexception connection refused: connect"   Check
DataBase Connection
DataBase Connection  How to connect java and Oracle 10g? Tell me Jdbc connection
Connection pooling
Connection pooling  Sir, In my project i want to implement connection pooling with ms-sql server 2005. i wrote the code in JSP like this... <% Connection con=DbCon.getConnection(); Statement stmt
JDBC connection
JDBC connection  ![alt text][1]I got exception in Connecting to a MySQL Database in Java. The exception is ClassNotFoundException:com.mysql.jdbc.Driver wat is the problem
connection - SQL
connection  how can i establish connection between netbean_ide6.9 with mysql or oracle  Hi Friend, Please visit the following link: http://www.roseindia.net/jsf/visual-jsf.shtml Hope that it will be helpful
ODBC connection
ODBC connection   import java.sql.*; import java.util.*; public...("password","tiger"); Connection con=d.connect(s,p); Statement st... the connection
Advertisements
 

 

 

DMCA.com