Menu

help in generating the source code

Help
2006-04-12
2013-04-25
  • Celinio Fernandes

    I am using eclipse 3.1, running a build.xml file and a build_compile.xml file to generate the API based on the schema of my Oracle database.
    Here is the code of the build files :

    build.xml
    <!--put sql2java.jar,ojdbc.jar,mysql.jar in ./lib-->
    <project name="generate sql2java source codes"  default="generate">
     
      <property name="lib.dir" location="lib" />
      <property name="src.dir" location="src\com\sql2java"/>
      <property name="backup.dir" location="bak"/>
      <!--modify the sections above for your settings-->
     
      <path id="my.classpath">
        <fileset dir="${lib.dir}">
          <include name="*.jar"/>
        </fileset>
        <!-- properties file is generated in the location below -->
        <!-- pathelement path="lib\mysql.jar; lib\sql2java.jar; lib\ojdbc14.jar"/ -->
        <!-- pathelement location="bjcz.properties"/ -->
      </path>

      <target name="prepare">
        <mkdir dir="${src.dir}"/>
      </target>

      <!-- GENERATE THE SOURCE CODE TO ACCESS YOUR DB -->
      <target name="generate" depends="prepare">
          <echo message="Connecting to DB"/>
        <java classname = "com.netkernel.sql2java.Main" fork="true">
          <classpath refid="my.classpath" />
          <arg value="sql2java.properties"/>
        </java>
      </target>
     
    </project>

    build_compile.xml

    <project name="compile source to classes" default="compile">
        <property name="src.dir" location="src\com\sql2java"/>
      <!--modify the sections above for your settings-->

        <target name="compile">
            <javac srcdir="${src.dir}" destdir=""/>
        <!--DONT NEED TO INDICATE DESTDIR, BECAUSE mgrwriter.package HAS BEEN SET IN DB.PROPERTY-->
        <!--DESTDIR WILL BE CREATED ACCORDING TO THE PACKAGE PATH-->
        </target>
    </project>

    The ant tasks in the build files perform without error but i dont see any API source being generated.

    Can anyone help or give some advice here ?
    Thank you very much for your help.

     
    • Theodor Willax

      Theodor Willax - 2006-04-21

      Please post your sql2java.properties. I think there is the problem.

      Theo

       

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.