Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem Getting Started with oracle database from Hibernate ?

 
signor Rhena
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any idea ?
I am following every steps on
http://www.hibernate.org/152.html
Getting Started
Day 1: Download and Install Hibernate
a. Download Hibernate and extract the archive
(Done succesfully Hibernate 3.0.5, expand in C dir so hibernate
is in C:\hibernate-3.0 )

b. Place your JDBC driver jar file in the lib directory
(I am using oracle database so I did copy classes12.jar file to
C:\hibernate-3.0\lib)

c. edit etc/hibernate.properties, specifying connection settings for your database (Hibernate will create a schema for the demo automatically)
I just did this for Oracle

#hibernate.dialect org.hibernate.dialect.OracleDialect
hibernate.dialect org.hibernate.dialect.Oracle9Dialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username scott
hibernate.connection.password tiger
hibernate.connection.url jdbc racle:thin:@GRDP01USG74053:1521:rambodb

I got error ? saying
[java] 13:54:32,229 INFO DriverManagerConnectionProvider:86 - connection properties: {user=scott, password=****}
[java] 13:54:34,532 ERROR SchemaExport:179 - schema export unsuccessful
[java] java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
[java] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
[java] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
[java] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
[java] at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
[java] at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
[java] at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
[java] at java.sql.DriverManager.getConnection(Unknown Source)
[java] at java.sql.DriverManager.getConnection(Unknown Source)
[java] at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:
[java] at org.hibernate.tool.hbm2ddl.SchemaExport$ProviderConnectionHelper.getConnection(SchemaExport.java:432)
[java] at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:130)
[java] at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:99)
[java] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:264)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
[java] at org.hibernate.auction.Main.main(Main.java:367)
[java] 13:54:34,532 INFO SessionFactoryImpl:379 - Checking 0 named queries
[java] Setting up some test data
[java] 13:54:34,552 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc racle:thin:@GRDP01USG74
[java] 13:54:37,006 WARN JDBCExceptionReporter:71 - SQL Error: 17002, SQLState: null
[java] 13:54:37,006 ERROR JDBCExceptionReporter:72 - Io exception: The Network Adapter could not establish the connection
[java] org.hibernate.exception.GenericJDBCException: Cannot open connection
[java] at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
[java] at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
[java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
[java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
[java] at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:301)
[java] at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:110)
[java] at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:137)
[java] at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:49)
[java] at org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:24)
[java] at org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271)
[java] at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1079)
[java] at org.hibernate.auction.Main.createTestAuctions(Main.java:285)
[java] at org.hibernate.auction.Main.main(Main.java:369)
[java] Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
[java] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
[java] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
[java] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
[java] at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
[java] at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
[java] at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
[java] at java.sql.DriverManager.getConnection(Unknown Source)
[java] at java.sql.DriverManager.getConnection(Unknown Source)
[java] at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:
[java] at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:298)
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure your connection url is correct?
 
signor Rhena
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is ? I did test using some Java test program? It did work?
hibernate.connection.url jdbc oracle:thin:@GRDP01USG74053:1521:rambodb
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic