ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claudio Miranda <cmira...@eversystems.com.br>
Subject Re: Running sql build script in HypersonicSQL [FIXED]
Date Tue, 21 Nov 2000 12:11:34 GMT

The problem was fixed, just removing the attribute print="yes",
very thanks for all



Claudio Miranda wrote:

> /* Sorry for the last message subject */
> 
> 
>  Dear users, I am using ant 1.2 to build a sql script, like this
> 
>    <target name="hsql.sql">
>       <sql driver="org.hsql.jdbcDriver"
>            url="jdbc:HypersonicSQL:hsql://localhost"
>            userid="sa"
>            password=""
>            print="yes"
>            classpath="../lib/hsql.jar"
>            src="hypersonic.sql"
>       />
>    </target>
> 
> the hypersonic.sql is
> 
> CREATE TABLE UserOne (
>        userId               INTEGER NOT NULL,
>        name                 VARCHAR(50) NOT NULL,
>        user_name             VARCHAR(20) NOT NULL,
>        PRIMARY KEY (userId),
>        UNIQUE (user_name)
> );
> 
> CREATE TABLE GroupOne (
>        groupName            VARCHAR(20) NOT NULL,
>        userId               INTEGER NOT NULL,
>        PRIMARY KEY (groupName, userId),
>        FOREIGN KEY (userId) REFERENCES UserOne (userId)
> );
> 
> when running with command prompt ant hsql.sql, the first sql script runs 
> fine, then the second sql script fail with the following stacktrace
> 
> java.lang.NullPointerException
>         at org.hsql.jdbcResultSet.getColumnName(jdbcResultSet.java:1962)
>         at 
> org.apache.tools.ant.taskdefs.SQLExec.printResults(SQLExec.java:535)
>         at org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLExec.java:496)
>         at 
> org.apache.tools.ant.taskdefs.SQLExec.runStatements(SQLExec.java:425)
>         at 
> org.apache.tools.ant.taskdefs.SQLExec$Transaction.runTransaction(SQLExec.java:592) 
> 
>         at 
> org.apache.tools.ant.taskdefs.SQLExec$Transaction.access$0(SQLExec.java:589) 
> 
>         at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:366)
>         at org.apache.tools.ant.Target.execute(Target.java:142)
>         at org.apache.tools.ant.Project.runTarget(Project.java:818)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:532)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:506)
>         at org.apache.tools.ant.Main.runBuild(Main.java:420)
>         at org.apache.tools.ant.Main.main(Main.java:149)
> 
> 
> when I run the hypersonic.sql script from a dummy test class, the 
> hypersonic.sql runs fine,
> and in HypersoncSQL Console, the first create table show fine, then the 
> connection is closed, showing
> 0:DISCONNECTED



   Claudio Miranda
   ___________________________________
   SUN Certified Programmer for JAVA 2


Mime
View raw message