I'm trying to write a Jira plugin. Now I want to acess the database with DatabaseAccessorImpl but that class can't be resolved. I opened the project with IDEA and looked at com.atlassian.jira.database but it only has 4 classes. The docs say there should be DatabaseAccessorImpl here but I only have DatabaseAccessor. I have API version 7.13.0
Hi @Frieder Hannenheim welcome on the community.
Jira uses OSGi as framework which solves dependencies between components. It also provides two maven dependencies
I guess, you have configured jira-api to be part of your maven configuration and it is correct as you should not use jira-core if not necessary.
So you really need to use com.atlassian.jira.database.DatabaseAccessor which is part of public API (it is an interface which you can use to call implementation in com.atlassian.jira.database.DatabaseAccessorImpl)
I was able to get a Database connection with ConnectionFactory but now I get a
java.sql.SQLSyntaxErrorException: (conn=36516) SELECT command denied to user 'username@hostname' for table 'AO_9F39CD_TLFIELDVALUE'
which is weird because the user has all permissions in the Database. Do I need to provide a Password? Heres's my code:
java.sql.Connection connection = ConnectionFactory.getConnection("defaultDS");
Statement s = connection.createStatement();
ResultSet result = s.executeQuery("SELECT\n" +
"max(anb.FIELDVALUELONG) as lastAccountNumber\n" +
"FROM \n" +
"et1_jira.AO_9F39CD_TLFIELDVALUE anb \n" +
"WHERE \n" +
I'm trying to access data from another plugin. Is that not possible?
No, user and password is configured in your dbconfig.xml file. I just found out you want to get data for CRM App. On Server and DC it has some REST API documented. It is standard way of how to interact with the application:
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events