You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I wonder if I can get a JDBC connection to the JIRA/Confluence database from plugin code and access the tables created by the ActiveObjects plugin.
Is that possible?
If so: Would that still work reliably on a different JIRA/Confluence instance with different configuration, specifically with a different database vendor?
You can definitely get the DS info or Connection from plugin code and use it to access AO tables.
DatasourceInfo datasourceInfo = new DefaultOfBizConnectionFactory().getDatasourceInfo(); Connection connection = new DefaultOfBizConnectionFactory().getConnection();
AO tables follows a unique naming strategy, which you can find at https://developer.atlassian.com/docs/atlassian-platform-common-components/active-objects/developing-your-plugin-with-active-objects/active-objects-faq/table-names. The names stay the same across instances.
Having said that, it is recommended to use the ActiveObjects APIs to interact with the AO tables.
Not really. I mostly opt for AO APIs but have done it via direct JDBC calls for complex scenarios. Other than that, it is normal JDBC!
I get null when I try accessing JDBC info
JdbcDatasourceInfo jdbcDatasourceInfo = new DefaultOfBizConnectionFactory().getDatasourceInfo().getJdbcDatasource();
However the JNDI Datasource works
Any clues ?
I am using SDK with
Be very careful. AO does have some caching built in so if you mix the access algorithm (API vs direct jdbc) you might see some strange results.