db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bullard, Jeffrey W. Dr." <jeffrey.bull...@nist.gov>
Subject Re: newbie can't connect to/export from MySQL with ant task
Date Wed, 13 Jan 2010 22:06:19 GMT

Thanks, Tom, that was a big help, and now the problem seems to be solved.  Here's what I did:
I installed SquirrelSQL and tried to connect to the same MySQL database, and I received the
following error when I tried to specify the com.mysql.jdbc.Driver driver:

Could not find class com.mysql.jdbc.Driver in neither the Java class path nor the Extra class
path of the MySQL Driver driver definition:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

So the driver wasn't found, which led me to suspect that the mysql-connector-java-3.1.12-bin.jar
was not in my CLASSPATH.  So I added it to my CLASSPATH and now everything seems to be working
fine.  Not really a DdlUtils issue after all, but you really helped me out.  Thanks again.


On 1/13/10 3:48 PM, "Thomas Dudziak" <tomdzk@gmail.com> wrote:

Since Ddlutils doesn't do anything unusual as far as JDBC is
concerned, could you try to connect with that connection information
and the same driver jar, e.g. by using SquirrelSQL or something
similar (but Java/JDBC based) ?


On Wed, Jan 13, 2010 at 12:45, Jeffrey W. Bullard
<jeffrey.bullard@nist.gov> wrote:
> I added the verbosity parameter to the task like this in the build.xml file:
> <databaseToDdl modelName="MigrateTest" verbosity="debug">
>    <database url="jdbc:mysql://localhost:3306/vcctl_user"
>        driverClassName="com.mysql.jdbc.Driver"
>        username="root"
>        password="vcctl7"/>
>    <writeSchemaToFile outputFile="db-schema.xml"/>
>    <writeDataToFile outputFile="data.xml"/>
> </databaseToDdl>
> but the output to stdout is exactly the same as before.  Is there a log file
> somewhere that I should be checking?
> Jeff
> On Jan 13, 2010, at 3:29 PM, Thomas Dudziak wrote:
>> Could you increase the verbosity of the task (see
>> http://db.apache.org/ddlutils/ant/org.apache.ddlutils.task.DatabaseToDdlTask.html)
>> to debug to get more detail logging, and post that here ?
>> Tom
>> On Wed, Jan 13, 2010 at 11:20, Jeffrey W. Bullard
>> <jeffrey.bullard@nist.gov> wrote:
>>> Hi,
>>> I'm trying to export a MySQL database using DdlUtils.  I went through a
>>> tutorial (http://db.apache.org/derby/integrate/db_ddlutils.html) that
>>> showed
>>> how to export a derby DB and I'm trying to modify the build.xml file to
>>> do
>>> the same thing for a MySQL database on my local machine.  The build.xml
>>> file
>>> is copied below.
>>> When I run "ant export-source-db", I get the following error:
>>> build.xml:16: Could not read the schema from the specified database:
>>> Could
>>> not get a connection from the datasource
>>> I have no doubt that my line 16 is wrong, but I cannot find any
>>> information
>>> about the correct format for connecting to a MySQL database.  The full
>>> path
>>> to the database on my machine is /usr/local/mysql/data/vcctl_user
>>> Other information:  My mysql server is definitely running on the machine,
>>> and the vcctl_user database can be accessed from within mysql from the
>>> command line (show tables, etc.).
>>> Thanks in advance for any help about how I can properly connect to MySQL
>>> database.
>>> <?xml version="1.0"?>
>>> <project name="MigrateToDerby" basedir=".">
>>>  <path id="classpath">
>>>     <fileset dir="./lib">
>>>        <include name="**/*.jar"/>
>>>     </fileset>
>>>  </path>
>>>  <target name="export-source-db" description="Dumps db structure and
>>> data">
>>>     <taskdef name="databaseToDdl"
>>>             classname="org.apache.ddlutils.task.DatabaseToDdlTask">
>>>        <classpath refid="classpath"/>
>>>     </taskdef>
>>>     <databaseToDdl modelName="MigrateTest">
>>>         <database url="jdbc:mysql://localhost:3306/vcctl_user"
>>>                driverClassName="com.mysql.jdbc.Driver"
>>>                username="root"
>>>                password="vcctl7"/>
>>>        <writeSchemaToFile outputFile="db-schema.xml"/>
>>>        <writeDataToFile outputFile="data.xml"/>
>>>     </databaseToDdl>
>>>  </target>
>>> </project>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message