-->
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.  [ 13 posts ] 
Author Message
 Post subject: Reversing Oracle DB : Invalid column name
PostPosted: Wed Apr 12, 2006 5:45 pm 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
When I try to reverse engineer an oracle database I'm getting an error in the error log. Any ideas ?

java.sql.SQLException: Invalid column name
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:219)
at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:3920)
at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:661)
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1308)
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:400)
at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:65)
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: Thu Apr 13, 2006 5:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use an uptodate driver

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 11:05 am 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
Well, I thought I do. To make sure I went to oracle an got this release

Oracle9i 9.0.1JDBC Drivers for use with JDK 1.2.x & 1.3.x

Same behavior! Something is wrong. My config file looks like this...


Code:
<hibernate-configuration>
    <session-factory name="sessionFactory">
        <property name="hibernate.cglib.use_reflection_optimizer">true</property>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.password">test</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@server:1521:dev</property>
        <property name="hibernate.connection.username">test</property>
        <property name="hibernate.default_catalog">dev</property>
        <property name="hibernate.default_schema">test</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
    </session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 11:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use oracle 10 drivers then. they work fine with oracle 9.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 11:10 am 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
Maybe this will help more

Code:
Available catalogs:

   at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
   at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.handleSQLException(JDBCMetaDataDialect.java:86)
   at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:50)
   at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:400)
   at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:65)
   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.eclipse.ui.model.BaseWorkbenchContentProvider.getChildren(BaseWorkbenchContentProvider.java:68)
   at org.hibernate.eclipse.console.workbench.DeferredContentProvider.getChildren(DeferredContentProvider.java:57)
   at org.eclipse.ui.model.BaseWorkbenchContentProvider.getElements(BaseWorkbenchContentProvider.java:77)
   at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.evaluateIfTreeEmpty(CheckedTreeSelectionDialog.java:376)
   at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.open(CheckedTreeSelectionDialog.java:226)
   at org.hibernate.eclipse.mapper.editors.reveng.TablePropertiesBlock.doAdd(TablePropertiesBlock.java:130)
   at org.hibernate.eclipse.mapper.editors.reveng.TablePropertiesBlock$1.widgetSelected(TablePropertiesBlock.java:90)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
   at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
   at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
   at org.eclipse.core.launcher.Main.run(Main.java:973)
   at org.eclipse.core.launcher.Main.main(Main.java:948)
Caused by: java.sql.SQLException: Invalid column name
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)
   at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:5153)
   at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:698)
   at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1505)
   at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.convertRow(JDBCMetaDataDialect.java:79)
   at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:47)
   ... 35 more


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 11:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
...still, this part of the trace:

Code:
Caused by: java.sql.SQLException: Invalid column name
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)
   at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:5153)
   at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:698)
   at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1505)
   at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.convertRow(JDBCMetaDataDialect.java:79)


..shows that we are simply just calling getString with a column name, and this column name is the standard name for index and works on every *JDBC* compatible driver.

Oracle's driver has a bug here - use a more recent one.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 11:28 am 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
Hm...

Besides
http://www.oracle.com/technology/softwa ... nsoft.html

Is there any overnigh release or something like that ?

Thanks,
Q


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 11:40 am 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
Okay - for some reason the problem is there even with the latest drivers picked from here

http://www.oracle.com/technology/softwa ... index.html

I tried with both 9i and 10g release2.

Any other idea ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 12:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well it works for me :and users have previously reported it and got it fixed by using an uptodate driver. are you 110% sure that it is picking up the new driver and not somehow shadowed on the classpath

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 12:04 pm 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
I will restart my eclipse and try it again! Keep in touch then


Top
 Profile  
 
 Post subject: You good!
PostPosted: Thu Apr 13, 2006 12:17 pm 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
That helped Max.

One would think that there aren't spookie things happening when changing the driver jar in edit configuration. It seems that indeed once the eclipse loaded the driver class there is no way to replace it but to restart eclipse.

I think all the ops should be performed on a different JVM, don't you think ?


One problem solved.

I have this other issue that no one wanted to reply to
http://forum.hibernate.org/viewtopic.ph ... highlight=
Do you dare to tackle it ?

Much appreciated your help!
Q


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 12:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes, i want to add support for "remote vm" of this stuff...wanna help ? :)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 12:42 pm 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
I wish I had time Max ... :(


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