Just for beautifying the log: you could specify a 'taskname' <exec taskname="update-db-tables" .../>
So you get a [update-db-tables] ... instead of [exec] ... Jan > -----Ursprüngliche Nachricht----- > Von: Eric Fetzer [mailto:elstonk...@yahoo.com.INVALID] > Gesendet: Donnerstag, 29. August 2019 16:04 > An: user@ant.apache.org > Betreff: Re: Issue with sql task accessing MySql > > Just to get the solution documented this thread, here's what I did. > This is a winders 7 machine running ant in cygwin. The ant call: > > <exec executable="c:\cygwin\bin\bash.exe"> <arg > value="update_build_table.sh"/> <arg value="${pk_build}"/> > <arg value="${full.buildnumber}-${build-time}"/> <arg > value="${result}"/> </exec> The bash script: > > #!/usr/bin/bash# > > ssh myUser@myMachine "mysql -u mySqlUser -pmySqlPassword mySqlDB -e > \"CALL sp_setBuildStatus('$1','$2','$3')\""if [ $? -eq 0 ]then echo > "The build table has been updated with the status $3"else echo > "Build table was not updated" exit 1fi > > Of course passwordless ssh needs to be established from build machine to > mySql machine... On Thursday, August 29, 2019, 09:48:01 AM EDT, Eric > Fetzer <elstonk...@yahoo.com.INVALID> wrote: > > Thanks Stefan! Took the easy path and outsourced the update to a > simple bash script that ssh's to the MySql Server and runs the SProc > there. Thanks for all your help! > On Wednesday, August 28, 2019, 04:02:17 PM EDT, Stefan Bodewig > <bode...@apache.org> wrote: > > On 2019-08-28, Eric Fetzer wrote: > > > Is there a way to set that version JUST for this call? > > I'm afraid there is no way to run the <sql> task in a different JVM than > the rest of Ant. > > Judging from > https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-versions.html > your MySQL Connector requires Java8 as a minimum. > > But then again the same page also claims the Connector version 5.1 - > which only requires Java 5 - would work with the latest MySQL server > (except for using certain ciphers in TLS). > > By no means am I a MySQL expert. > > > We're building a legacy application here that CANNOT upgrade to a > > newer version of Java... > > Understood. > > You could try to move the sql part to a different build file and only > run that in a different JVM (via <exec>, <ant> will not fork a new VM). > Or you could try to build with Java8 and tell all your <javac> tasks to > use the compiler of Java7. > > In either case this sounds like quite a bit of work. I'm sorry I haven't > got any better news. Maybe anybody with more MySQL experience than I has > has more ideas. > > Stefan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional > commands, e-mail: user-h...@ant.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org