hi dear vendor, I’m using confluence scriptrunner now. in my script , I want to do some interaction with my mysql DB. I use follow code: import groovy.sql.Sql def connect = Sql.newInstance("jdbc:mysql://myhost", "username", "password", "org.gjt.mm.mysql.Driver") def sql_insert = "INSERT INTO pageinfo VALUES('1','testname1')" connect.execute(sql_insert) but I meet the ERROR " org.gjt.mm.mysql.Driver could be found. I think it is due to I lack the MySQL-connecction-java.jar could you tell me how could I import a third-party lib in confluence? thanks for help.
Hi @Jianming_ZHU,
You need to add the "MySQL-connection-java.jar" in the folder "{confluence-install}/lib", restart Confluence, and try to execute the script.
Cheers,
Adrián.
Hi Adrian,
thanks the support very much.
Now I have resolved this issue.
by the way, I have another question about scriptrunner. I could trigger some post-action via EventHandler, is there anyway to do some pre-action?
for example, if I delete a page, before confluence execute the delete action, could I trigger sth via script?
thanks very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jianming_ZHU,
If my comment helps you to solve your problem can you please mark as accepted answer? please, this can help other people to find a solved question.
About your new question, you need to look at the Script Runner documentation about event Handlers: https://scriptrunner.adaptavist.com/latest/confluence/ConfluenceEventHandlers.html
Cheers,
Adrián.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.