Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get JNDI connections?

Fatih şentürk July 26, 2015

Hey guys,

I am developing JIRA gadget thats about sql queries. I wanna use lots of DB.  I am saving queries with names , all query and selected DB. In saving process , i wanna list all jndi options. How can i get it ? I guess, when JIRA is starting system read something in somewhere for getting DBs (~ context.xml). So how can i get JNDI options ?

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2015

Just to check, you do mean these SQL queries are for some other system(s)?

 

Fatih şentürk July 26, 2015

On the same system but for different DBs. I have just one jira but lots of DB like postgersql, mysql and these all have some data. i am saving which db for writed query then i will retrive on dashboard with gadget data.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2015

So you're not trying to read the Jira database, which would be slow, pointless and dangerous. That's good. I've got http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html#Oracle_8i%2C_9i_&_10g as a bookmark - although it's old, the code snippets still apply I think

Fatih şentürk July 27, 2015

This doc is about all different DB connection. Is there anyway to getting connection without reading context.xml ? I am trying something like that : Contect ctx=new Initialcontext(); ctx.lookup(); But i cant get context

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 27, 2015

Yes, you said you wanted to get database connections from JNDI. The ctx stuff is velocity, it's done at the front end. It is about displaying html to the user, it has nothing to do with the back end, it simple serves up stuff the java hands it. If you want to use data from query in it, you're going to have to build all the java code that reads the other databases for that query and pulls it back through the back end to present it to the front-end as java objects. (And and context.xml has nothing to do with velocity either)

TAGS
AUG Leaders

Atlassian Community Events