-->
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.  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: hibernate tools with oracle
PostPosted: Mon Jan 02, 2006 9:11 am 
Newbie

Joined: Mon Jan 02, 2006 6:54 am
Posts: 4
Hello,

I am trying to use hibernate tools with oracle 10g.

What is default_catalog and default_schema? In hibernate tools 3.0 default_schema had to be defined, so htools would not read the entire database. In 3.1, if I put my database name in default schema, in console the tables do not show up. If i define a default schema, then nothing shows up in tables.

Could you define how to put default schema and catalog? Lets say my oracle username (and schema) is `hibernator` - what do I have to write in default catalog?

Best regards,
Cam Bazz


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 02, 2006 2:11 pm 
Newbie

Joined: Thu Dec 29, 2005 11:44 am
Posts: 7
Hi,

I am also trying to use hibernate tools 3.1 with oracle but version 8.
If i don't put the schema name i have an error message.
If i put it, i don't have any tables like you.

I only have an error
"Problem while reading database schema : Invalid column name"

Any way to get a detailed error message?
It works fine with hibernate 3.0


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 3:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the log error messages is in the Error Log View.

Also remember that the schema/catalog name is case sensitive in oracle and thus most likely it should be HIBERNATOR for your schema.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: bug found.
PostPosted: Tue Jan 03, 2006 5:14 am 
Newbie

Joined: Mon Jan 02, 2006 6:54 am
Posts: 4
Hello Max,

I noticed for hibernate tools to work correctly with oracle,

the oracle driver class : oracle.jdbc.driver.OracleDriver

has to be: oracle.jdbc.OracleDriver

otherwise it does not work.

Best Regards,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 5:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
has to be something else on your side.

Our unit tests runs with oracle.jdbc.driver.OracleDriver and that works perfectly.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 6:14 am 
Newbie

Joined: Thu Dec 29, 2005 11:44 am
Posts: 7
i still have this invalid column name error
(in fact "Nom de colonne non valide", french version.)

Even if i drop ALL my tables and use this simple statement:

create table test (
test VARCHAR2(3) not null
);

the log:
Code:
Caused by: java.sql.SQLException: Nom de colonne non valide
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
   at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:4383)
   at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:667)
   at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1374)
   at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.convertRow(JDBCMetaDataDialect.java:79)
   at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:47)
   ... 10 more



damned!


Top
 Profile  
 
 Post subject: i get the same error with oracel 8.1.7
PostPosted: Tue Jan 03, 2006 6:23 am 
Newbie

Joined: Tue Jan 03, 2006 2:28 am
Posts: 1
i get the same error with oracel 8.1.7.
the execute strack is:
can't load database schema.
and throw a exception:
java.sql.SQLException: invaild name
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:4383)
at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:667)
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1374)
at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.convertRow(JDBCMetaDataDialect.java:79)
at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:47)
at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:382)
at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:62)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$1.execute(LazyDatabaseSchemaWorkbenchAdapter.java:79)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:70)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:39)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:31)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:70)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 6:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
for some reason their jdbc driver does not return a "REMARKS" column (which it should).

Try and use a more uptodate driver.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 6:43 am 
Newbie

Joined: Thu Dec 29, 2005 11:44 am
Posts: 7
okaaayy, i've looked in the hibernate tools code, i think i understand what's going on :

reading database schema :
(org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:382))
Code:
getConnection().getMetaData().getTables(catalog, schema, table, new String[] { "TABLE", "VIEW" });


then reveng reading tables schema doesnt find one of these columns :
(org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:382))
Code:
element.put("TABLE_TYPE", tableRs.getString("TABLE_TYPE"));
element.put("REMARKS", tableRs.getString("REMARKS"));


this is a driver problem i guess, oracle 8.1.7, drivers are classes12.jar.[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 6:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes - its a driver issue, and oracle 10 drivers can be used with oracle 8 afaik.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 6:47 am 
Newbie

Joined: Thu Dec 29, 2005 11:44 am
Posts: 7
oh looks like we post at the same time, happy to see tha my analyse was right...

thanks!
digging the web for a driver...
i love oracle and their great products *smile*


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 7:02 am 
Newbie

Joined: Thu Dec 29, 2005 11:44 am
Posts: 7
afai'm testing, oracle 10 drivers are working...

thanks max, too bad i can't give you some credits :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 1:22 pm 
Newbie

Joined: Fri Aug 04, 2006 6:09 am
Posts: 18
I'm using the latest oracle drivers (10g) and Eclipse 3.2 and the latest Hibernate Tools plugins for Eclipse.

I cannot see my tables!!!

I have tried uppercase/lowercase username/default schema, oracle.jdbc.driver.OracleDriver and oracle.jdbc.OracleDriver, Oracle9Dialect and OracleDialect.

No errors that i can see.

Not sure what to do next???

I'm pretty sure the connection is fine - it takes ages to come back with nothing!!!!

Here's my hibernate file:

<?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.password">tiger</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@278.33.50.69:1521:orcl01</property>
<property name="hibernate.connection.username">SCOTT</property>
<property name="hibernate.default_schema">SCOTT</property>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
</session-factory>
</hibernate-configuration>

My classpath for the console configuration only has the jdbc driver. I have no current hibernate artifacts (in fact i haven't put Hibernate in my project yet).

Cheers

R


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 2:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
have you tried using the pure ant version and enable debug logging ?

fyi, it works flawless for me so i have a hard time guessing for more possible problems ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 09, 2006 5:27 am 
Newbie

Joined: Fri Aug 04, 2006 6:09 am
Posts: 18
Hi,

just an update. I've got it working now. The problem was the jdbc url - it seems you cannot provide host as an ip address; you must use the hostname of the server.

Thanks

Rakesh


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next

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.