JDBC Checker

From MediaWiki

(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
             basedir=".">
             basedir=".">
   <description>
   <description>
-
       ANT build file which allows to check compatibility  
+
       ANT build file which allows checking the compatibility  
       between JDBC driver and database.
       between JDBC driver and database.
   </description>
   </description>
   <target name="check">
   <target name="check">
-
    <sql driver="<insert JDBC URL>"
+
        <sql driver="<insert JDBC URL>"
-
          onerror="stop"
+
            onerror="stop"
-
            url="<insert connection URL>"
+
        url="<insert connection URL>"
-
            userid="<insert user name>"
+
        userid="<insert user name>"
-
            password="<insert password>">
+
        password="<insert password>">
-
            <classpath>
+
        <classpath>
-
              <pathelement path="<insert path to JDBC driver here>"/>
+
            <pathelement path="<insert path to JDBC driver here>"/>
-
            </classpath>
+
        </classpath>
-
            <!-- Uncomment in the case of MySQL database -->
+
        <!-- Uncomment in the case of Oracle database -->
-
            select * from tab;
+
        <!-- select * from tab; -->
-
            <!-- Uncomment in the case of Oracle database -->
+
        <!-- Uncomment in the case of MySQL database -->
-
            <!-- select 1; -->
+
        <!-- desc db; -->
-
            </sql>
+
        </sql>
   </target>
   </target>
   </project>
   </project>

Revision as of 09:26, 11 February 2008

This is a simple way of checking compatibility between JDBC driver and database with Ant. Ant has integrated support for access to SQL databases which is used by following build file

  [dusan@woodoo JDBCChecker]$ cat build.xml
  <project name="JDBC Checker"
           default="check"
           basedir=".">
  <description>
      ANT build file which allows checking the compatibility 
      between JDBC driver and database.
  </description>
  <target name="check">
        <sql driver="<insert JDBC URL>"
           onerror="stop"
        url="<insert connection URL>"
        userid="<insert user name>"
        password="<insert password>">
        <classpath>
           <pathelement path="<insert path to JDBC driver here>"/>
        </classpath>
        </sql>
  </target>
  </project>
Personal tools