Thanks Antoine, that was it. It was a no brainer that I didn't see. Much appreciated.
Vang mtbvang wrote: > > Hi, > > I am getting the following error when using the > /mysql-connector-java-5.1.10-bin.jar in an Ant 1.7 SQL task. For some > reason a ? is being placed at the beginning of my comment and sql > statement lines. I've included the error from the cmd prompt and my and > tasks below. Any one know what's going on? > > > C:\dev\Projects\project-name>ant database.create > Buildfile: build.xml > Trying to override old definition of datatype resources > > database.create: > [sql] Executing resource: > C:\dev\Projects\project-name\MySQL\project\0.1.0\project-name > .sql > [sql] Failed to execute: ?-- SQL Manager 2007 for MySQL 4.2.0.2 > [sql] SET FOREIGN_KEY_CHECKS=0 > > BUILD FAILED > com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an > error in > your SQL syntax; check the manual that corresponds to your MySQL server > version > for the right syntax to use near '?-- SQL Manager 2007 for MySQL 4.2.0.2 > SET FOREIGN_KEY_CHECKS=0' at line 1 > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > > at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct > orAccessorImpl.java:39) > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC > onstructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) > at com.mysql.jdbc.Util.getInstance(Util.java:381) > at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) > at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558) > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109) > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2642) > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2571) > at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:782) > at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:625) > at org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLExec.java:565) > at org.apache.tools.ant.taskdefs.SQLExec.runStatements(SQLExec.java:535) > > at org.apache.tools.ant.taskdefs.SQLExec$Transaction.runTransaction(SQLE > ... > <property name="db.server" value="localhost"/> > <property name="db.server.port" value="3306"/> > <property name="db.name" value="project-name"/> > <property name="db.username" value="root"/> > <property name="db.password" value="xxxxxx"/> > <property name="db.driver" value="com.mysql.jdbc.Driver"/> > <property name="db.url" > value="jdbc:mysql://${db.server}:${db.server.port}/${db.name}"/> > <target name="database.create" description=""> > <sql driver="${db.driver}" > url="${db.url}" > userid="${db.username}" > password="${db.password}" > autocommit="true" > onerror="abort" > encoding="UTF-8" > print="true" > escapeprocessing="false"> > <classpath> > <pathelement > location="${project.lib}/mysql-connector-java-5.1.10-bin.jar"/> > </classpath> > <transaction src="${basedir}/MySQL/project-name/0.1.0/project-name.sql"/> > </sql> > </target> > > Thanks > > Vang > -- View this message in context: http://old.nabble.com/SQl-task-error---A---placed-at-beginning-of-lines-of-sql-file-tp27137341p27138902.html Sent from the Ant - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org