Hi all,
I was wondering if i could get some assistance.
I have a script step where i want to connect to my local mySQL and perform and update.
Here is my script
import groovy.sql.Sql
java.util.logging.Logger logger = java.util.logging.Logger.getLogger ""
logger.info("Script Update Step")
if (merchantid != null)
{
logger.info(merchantid.toString())
}
if (storename != "")
{
logger.info(storename)
}
File file = new File("/Users/seanfrogner/talechtools/Dockers/filesystem/api-talech/m2/repository/mysql/mysql-connector-java/6.0.6/mysql-connector-java-6.0.6.jar");
logger.info(file.length().toString());
if (file != null)
{
this.getClass().classLoader.rootLoader.addURL(new File('/Users/seanfrogner/talechtools/Dockers/filesystem/api-talech/m2/repository/mysql/mysql-connector-java/6.0.6/mysql-connector-java-6.0.6.jar').toURL())
}
try{
//def sql = Sql.newInstance("jdbc:mysql://127.0.0.1:3306/pos_local","posuser", "pospassword", "com.mysql.jdbc.Driver")
//sql.execute("UPDATE pos_local.merchant_store SET EQUIPMENT_SHIPPED = 0 WHERE ID = 831");
//def newsql = "UPDATE pos_local.merchant_store SET EQUIPMENT_SHIPPED = 0 WHERE ID = " + merchantid + ""
//sql.execute(newsql);
}
catch(e)
{
logger.info(e.toString())
}
I keep getting this error in the engine.
org.bonitasoft.engine.commons.exceptions.SBonitaRuntimeException : "java.lang.NullPointerException: Cannot invoke method addURL() on null object"
If i run it from the evaluator it will work since i can pick the jars. Also, i can get it to work through IntelliJ..
Anyone have any ideas
thx