You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Claudio Miranda <cm...@eversystems.com.br> on 2000/11/21 13:11:34 UTC

Re: Running sql build script in HypersonicSQL [FIXED]

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


Re: Running sql build script in HypersonicSQL [FIXED]

Posted by Claudio Miranda <cm...@eversystems.com.br>.
Dear Conor, very thanks by your 'look' at my message, and sorry my late 
response.

   Your assertion is correct (I think) because I tested this in oracle 
and works fine, and the hypersonic jdbc driver is not 100% jdbc compliant.

   Do you know other java rdbms opensource?

    VeryThanks4all


   Claudio Miranda
   ___________________________________
   SUN Certified Programmer for JAVA 2

Conor MacNeill wrote:

> Claudio,
> 
> I see you raised a bug report for this. I am not yet convinced this is a
> problem in ant. Your bug report stated that the connection had been
> closed by ant but I can't see where that would happen. In fact the call
> which fails is getColumnName which is only called if the calls
> getResultSet, getMetaData, and getColumnCount have succeeded.
> 
> I suspect therefore that it is the hypersonic JDBC driver which may be
> at fault. The fact that the NPE actually occurs in their code is another
> indication of this.
> 
> What do you think ?
> 
> Conor


RE: Running sql build script in HypersonicSQL [FIXED]

Posted by Conor MacNeill <co...@m64.com>.
Claudio,

I see you raised a bug report for this. I am not yet convinced this is a
problem in ant. Your bug report stated that the connection had been
closed by ant but I can't see where that would happen. In fact the call
which fails is getColumnName which is only called if the calls
getResultSet, getMetaData, and getColumnCount have succeeded.

I suspect therefore that it is the hypersonic JDBC driver which may be
at fault. The fact that the NPE actually occurs in their code is another
indication of this.

What do you think ?

Conor


> -----Original Message-----
> From: Claudio Miranda [mailto:cmiranda@eversystems.com.br]
> Sent: Tuesday, 21 November 2000 23:12
> To: ant-user@jakarta.apache.org
> Subject: Re: Running sql build script in HypersonicSQL [FIXED]
>
>
>
> 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.runTransacti
> on(SQLExec.java:592)
> >
> >         at
> >
> org.apache.tools.ant.taskdefs.SQLExec$Transaction.access$0(SQL
> Exec.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
>