0 Replies Latest reply on Aug 24, 2005 5:04 PM by Éric Daigneault

    Problem while reading database schema - Interbase

    Éric Daigneault Newbie

      Hi.

      I installed the Hibernate tools as Eclipse Pluging and tried to get the tables from an existing database (Reverse engineer Interbase).

      We were planning on moving our persistance layer to Hibernate but coding it anew would be quite a pain.

      After configuring Hybernate with the wizards (hibernate config and console) I tried to access the database content but the furthest I got was this an error in Eclipse`s error log with this :

      -----
      Problem while reading database schema
      Stack:
      org.hibernate.exception.GenericJDBCException: Could not get list of tables from database. Probably a JDBC driver problem.
      Configured schema:
      Configured catalog:
      Available schemas:
      Available catalogs:

      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
      at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:365)
      at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:47)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$1.execute(LazyDatabaseSchemaWorkbenchAdapter.java:55)
      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:44)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.fetchDeferredChildren(LazyDatabaseSchemaWorkbenchAdapter.java:30)
      at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
      Caused by: java.sql.SQLException: [interclient][interbase]arithmetic exception, numeric overflow, or string truncation
      at interbase.interclient.Statement.remote_EXECUTE_QUERY_STATEMENT(Unknown Source)
      at interbase.interclient.PreparedStatement.remote_EXECUTE_PREPARED_QUERY_STATEMENT(Unknown Source)
      at interbase.interclient.PreparedStatement.executeQuery(Unknown Source)
      at interbase.interclient.DatabaseMetaData.getTables(Unknown Source)
      at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:329)
      ... 7 more

      Session:
      eclipse.buildId=I20050627-1435
      java.version=1.4.2_03
      java.vendor=Sun Microsystems Inc.
      BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
      Command-line arguments: -os win32 -ws win32 -arch x86
      This is a continuation of log file D:\ProjectsFolder\workspace\Project\.metadata\.bak_0.log
      Created Time: 2005-07-04 14:21:54.504

      Content of the hibernate config file is as follows :

      <?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">interbase.interclient.Driver</property>
       <property name="hibernate.connection.password">masterkey</property>
       <property name="hibernate.connection.url">jdbc:interbase://127.0.0.1/C:/Database/Interbase/FILLER.IB</property>
       <property name="hibernate.connection.username">SYSDBA</property>
       <property name="hibernate.default_catalog"></property>
       <property name="hibernate.default_schema"></property>
       <property name="hibernate.dialect">org.hibernate.dialect.InterbaseDialect</property>
       </session-factory>
      </hibernate-configuration>