ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject Re: sql task encoding problem using sjis
Date Tue, 13 Apr 2004 19:06:50 GMT
Hi Karl, I had some troubles with MySQL and <sql> task
a mounth ago and might help you.

--- Karl Stenerud <karl@webartjapan.com> wrote:
> I'm getting errors when I try to import a mysql dump
> back into the database using the ant sql task (using
> ant 1.6.1).
> 
> 
> I created the dump with the following command:
> 
> karl@polinki:~/projects/post> mysqldump -u root post
> --add-drop-table >test/src/sql/initdb.sql
> 
> The created file itself is indeed an sjis file.
> 
> 
> The ant task looks like this:
>
---------------------------------------------------------------------
>   <target name="initdb-test" description="initialize
> the database">
>     <sql
>       autocommit="true"
>       driver="${test.database.driver}"
>       encoding="SJIS"
>       onerror="continue"
>       password="${test.database.password}"
>       src="${test.sql}/initdb.sql"
>       url="${test.database.url}"
>       userid="${test.database.user}">
>       <classpath refid="test.classpath"/>
>     </sql>
>   </target>
>
---------------------------------------------------------------------
> 
> This task worked fine until I added the postal
> information to the database.
>
How does this postal information looks like? I cannot
read it in my browser. One reason for failing is that
SJIS might be unknown encoding for JVM. (By the way
why it is upper case?)

You can also try with escapeprocessing and/or
keepformat attribuites of <sql> task.

It may also fail if you have add a comment with this
sign: #. MySQL accepts it as a comment, but Ant not
(this was my case and I simply stripped off lines
starting with #).

HTH Ivan
P.S. Just in every case: did you ensure yourself your
test/src/sql/initdb.sql runs correctly from mysql
console:
mysql> source test/src/sql/initdb.sql


	
		
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message