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.
Can you check you are using the correct version of jar files / JDK, also may be you can try connect to the DB using any other tool to make sure the DB is up and running fine. If you use Eclipse then you can use Data Source Explorer to test this.
Few notes available in oracle site about the dependency of the jar/java etc.. "•Oracle Database XE does not support JDK 1.2 and JDK 1.3, including all classes12*.* files. You need to use the ojdbc14.jar file with JDK 1.4.x instead."
Also if you find all the configuration seems to be correct, may be you can create a standalone java program to test the connectivity to the DB and make sure you have all the Java/Jar versions correct and the DB is up and running correctly. May be some thing like this http://www.javadb.com/connect-to-a-database-and-read-from-table