Mysql database connection error using custom script action

rpa

#1

I am trying to create a mysql connection from RPA express using custom script action.

Below is my custom script:

<database connection="jdbc:mysql://10.11.11.190/dbname" jdbcclass="com.mysql.jdbc.Driver"
    		username="username" password="dbpwd">
    		select * from tbl_as400
</database>

I want to fetch the above table “tbl_as400” data into csv file for further manipulation.
Please help me on this…!

Error message :-
Error executing CustomScriptAction
  com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=CustomScriptAction.ftl,id=1,name=Optional[CustomScriptAction],parent=-1,arguments=ActionArguments[delay=[0],xsi:type=[recorder:CustomScriptAction, recorder:CustomScriptAction],name=[abc],pollingInterval=[300],active=[true],script=[<database connection="jdbc:mysql://10.11.11.190/dbname" jdbcclass="com.mysql.jdbc.Driver"
    		username="username" password="dbpwd">

    		select * from tbl_as400
    </database>],awaitTimeout=[5000]]]
      at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:54)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:30)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:17)
      at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:53)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:153)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:113)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script2.groovy: 6: unexpected token: < @ line 6, column 1.
   <database connection="jdbc:mysql://10.11.11.190/dbname" jdbcclass="com.mysql.jdbc.Driver"
   ^

1 error

      at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
      at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:150)
      at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:120)
      at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:132)
      at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:350)
      at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:144)
      at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:110)
      at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:234)
      at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:168)
      at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:943)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:605)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:736)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:727)
      at com.workfusion.studio.rpa.recorder.playback.shell.GroovyShellWrapper.executeScript(GroovyShellWrapper.java:86)
      at com.workfusion.studio.rpa.recorder.playback.player.PlaybackContext.executeScript(PlaybackContext.java:65)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.executeBehavior(TemplateAction.java:35)
      at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:46)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:30)
      at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:17)
      at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:53)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:153)
      at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:113)
      at java.lang.Thread.run(Thread.java:745)

#2

can anyone help me on this…!

Below is my connection details:

Server IP : 10.11.11.11
Database name : empDB
Database username: root
Database pwd : pwd123
Table Name : tbl_as400

Mysql database has been installed on the virtual machine and I am trying to connect remotely. Due to localhost doesn’t work.

I need a sample connection string using above parameters.I want to fetch all the records from “tbl_as400” and store in CSV file for further manipulation.

Prompt response will be highly appreciated…!


#3

@vikas_rawat1 Do you use this code in the Script action in the recorder?

image


#4

yes I have tried but no luck. bcoz I need a connection string help. If you can write for me and revert back. So, that I can validate and will make any further modifications as per our need.

I already mentioned my database parameters.

Please help. I was looking for this solution very long time and didn’t get any success.


#5

@vikas_rawat1 there is currently no simplified RPA API for database connections.


#6