In case it's not clear, this Derby is running standalone, not embedded. The eclipse module gives you stuff so that you can start and stop it from within eclipse, and perhaps more.

From outside of eclipse I can telnet to derby on port 1527 (of course I can't type anything meaningful at it but I can see its errors from my typing what it considers garbage).

Rusty Wright wrote:
Ok, thanks.

As to why, it's my first time using Derby so I'm using the Eclipse Derby plugin/module. I suppose it's slightly easier since I don't have to start Derby before I start Eclipse and can manage it from within Eclipse.


Laurent ROCHE wrote:
Hi,

Have you tried to run ij to connect to Derby leave the connection opened and run the ant task ?

It's not a long term solution but that could for debug / testing the problem.
Just a thought.

Still I am a bit confused what do you mean by "I'm doing this in eclipse" and "When I start derby in eclipse its console says " ? Do you mean you are running derby from Eclipse by lauching the command in Eclipse ?
What's the point ?

I am using Eclipse and running Derby standalone or embeded in Tomcat ... but never from Eclipse ? ! ?

Cheers,
[EMAIL PROTECTED]
The Computing Froggy

----- Message d'origine ----
De : "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Mardi, 24 Avril 2007, 8h16mn 25s
Objet : what's wrong? can't connect to derby from ant

I'm doing this in eclipse but the derby is the network server flavor, not
the embedded one.  The output from ant is:

Buildfile: C:\users\rusty\workspace\products\build-ddl.xml
init:
database-setup:
[ddlToDatabase] Read schema file
C:\users\rusty\workspace\products\src\main\resources\ddl\products.xml

BUILD FAILED
C:\users\rusty\workspace\products\build-ddl.xml:12: Could not get a
connection from the datasource

Total time: 1 second

Here's my build-ddl.xml:

<?xml version="1.0" encoding="UTF-8"?>

<project default="database-setup">
    <target name="init">
        <taskdef
            name="ddlToDatabase"
            classname="org.apache.ddlutils.task.DdlToDatabaseTask"
        />
    </target>

    <target name="database-setup" depends="init">
        <ddlToDatabase>
            <database
                driverClassName="org.apache.derby.jdbc.ClientDriver"
                url="jdbc:derby://localhost:1527/products"
            />

            <fileset dir="src/main/resources/ddl">
                <include name="products.xml" />
            </fileset>

            <writeSchemaToDatabase
                failonerror="true"
                alterdatabase="true"
            />

        </ddlToDatabase>
    </target>
</project>

I can connect to derby using the url above using the "ij" interactive
command line sql thing in eclipse.

When I start derby in eclipse its console says:

Apache Derby Network Server - 10.2.2.0 - (485682) started and ready to
accept connections on port 1527 at 2007-04-24 04:16:32.784 GMT

Here is my products.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE database PUBLIC "database"
"http://db.apache.org/torque/dtd/database.dtd";;>
<database name="products">
    <table name="products">
        <column
            name="sku"
            type="VARCHAR"
            primaryKey="true"
            required="true"
        />

        <column
            name="name"
            type="VARCHAR"
            required="true"
        />
    </table>
</database>

Ant never seems to get a connection to derby; I can see that derby isn't
creating the directory and database like it does when I do the command at
the ij prompt.

Thanks for your help.








___________________________________________________________________________ Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses http://fr.answers.yahoo.com


--
Rusty Wright
UC Berkeley
IS&T Web Applications
510-643-9097  office
925-212-3774  cell

Reply via email to