Menu

java code not generated for oracle 10g

Help
Balaji
2007-12-01
2013-04-25
  • Balaji

    Balaji - 2007-12-01

    Is oracle 10g supported by sql2java?  When I run 'ant generate', helper code are generated but the java classes corresponding the tables are missing.
    However, the sample with hsql is working.

    sql2java 2.6.5
    jdk16
    oracle 10g

    sql2java.properties
    changed the connection params and sql2java is able to connect.
    Other parameters are left to the default settings.

    sql2java.xml has only the root node.
    <sql2java>
    </sql2java>

    When I do 'ant generate", I get the following:
    Buildfile: build.xml

    generate.code:
    [sql2java] GenerationTask: C:\tools\sql2java/src/config/sql2java.properties
    [sql2java] Connecting to iasauto on jdbc:oracle:thin:@myserver:1521:db10203 ...
    [sql2java]     Connected.
    [sql2java]     Database server :Oracle.
    [sql2java] Loading table list according to pattern % ...
    [sql2java] Loading columns ...
    [sql2java] Database::loadPrimaryKeys
    [sql2java] Loading imported keys ...
    [sql2java] Loading indexes ...
    [sql2java] Loading procedures ...
    [sql2java] getLoadingPath = .,src/templates/velocity/includes,
    [sql2java] Generating template src/templates/velocity//db/perschema/database.documentation.list.html.vm
    [sql2java]  .... writing to C:/temp/src\web/database/\index.html
    [sql2java]     web/database/\index.html done.
    [sql2java] Generating template src/templates/velocity//db/perschema/database.documentation.overview.html.vm
    [sql2java]  .... writing to C:/temp/src\web/database/\overview.html
    [sql2java]     web/database/\overview.html done.
    [sql2java] Generating template src/templates/velocity//db/perschema/database.documentation.txt.vm
    [sql2java]  .... writing to C:/temp/src\java\iasauto\tracker\data\database.txt
    [sql2java]     java\iasauto\tracker\data\database.txt done.

    ... <many more such generations> ...

    generate.graphs.check:

    generate.graphs:

    generate:

    BUILD SUCCESSFUL
    Total time: 16 seconds

    After the run, the destination dir has :
    config, java and web dirs
    java/package dir has only exception dir and the following files:
    database.txt
    database.properties
    GeneratedBean.java
    Manager.java

    Kindly let me know if any other settings are needed for sql2java to work on oracle 10g.

    Thanks
    Balaji

     
    • Alain Fagot Béarez

      It has already been reported that Oracle 10g does not list any table for the generation. As I do not have any such database available for testing I can not find the bug cause.

      I may suggest to you, to try playing with the configuration of accepted tables.  You may succeed by putting a jdbc.tablenamepattern like "%.%", "yourschema." or "yourschema.tableprefix".  I suspect but can not confirm that Oracle 10g does not like the current single "%".

      jdbc.tablenamepattern=%
      tables.include=
      tables.exclude=

      I hope you will find the origin of this error for it to be corrected in the next release.

      More specifically, you may run tests of the DatabaseMetaData.getTables() method and let me know what values of "schemaPattern" and "tableNamePattern" are permiting a result of "all tables in all schemas".

      Thanks for your help,
      Alain.

       
    • Balaji

      Balaji - 2007-12-04

      Thanks, Alain.

      The following code gives me "all tables in all schemas".

          String[] types = {"TABLE"};
          String schema = null;
          String tableNamePattern = "%";
          ResultSet rs = dbmd.getTables(null, schema, tableNamePattern, types);

      Passing the specific schema returns those tables alone.

      Will play with sql2java + jdbc.tablenamepattern and get back to you.

      hmmm ... meanwhile an uneasy favour from you.  After sql2java, I went through simpleorm, jpersist kind of tools.  None of them satisfied what I am looking for.  Can you suggest anything close to sql2java :-)
      (In return, I will run your tests!)

      Regards
      Balaji

       
    • Balaji

      Balaji - 2007-12-04

      Hi Alain,

      Mystry SOLVED - atleast for me :-)

      dbmd.getTables() is retriveing the table info if & only if the correct case of the schema is passed. In my case, the tool worked when I passed the schema name in all caps.

      Not sure if the metadata expects the name in caps or the name that was given during schema creation.

      Thanks for your timely reply.

      Regards
      Balaji

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.