• Post Reply Bookmark Topic Watch Topic
  • New Topic

datatable and databases

 
darko kalevski
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. I've got this dataTable below.
dataModel returns the resultset of the query (within backing bean):
select "+jazikbrowser+" from tglossary where CategoryID=10

jazikbrowser=jazik, and jazik is String variable from (at the bottom):
http://forum.java.sun.com/thread.jspa?threadID=677631&tstart=0

now the line <h utputText value="#{e.MK}"/> within dataTable should output the results from the query (single column, multiple rows - if there are any). Here MK is static for testing purposes and it is a field of the resultset. But in reality, what I need is e.jazikbrowser because I dont know which column the query will get it from the database as it is dependant on the variable jazikbrowser. But e.jazikbrowser is NOT functioning, it WONT work! How do i overcome this? Anyone has an idea?

Even if I make getJazikbrowser and setJazikbrowser...
and then use it in the dataTable like prijaviIspit.jazikbrowser ... i'm not sure i'll be able to concatenate (i dont see how)? cause generating the rows depends on the e.MK ...

or eventualyl to get jazikbrowser at jsf level (within the presentation page)?? is that possible

Thanks!!


<h anelGrid columns="1" styleClass="proba" rendered="#{prijaviIspit.prikaziTabela}">

<h ataTable value="#{prijaviIspit.dataModel}" var="e" first="#{prijaviIspit.redenBroj}" rows="15" styleClass="TabelaDiplomirani" headerClass="heder" rowClasses="nepar, par">
<h:column>
<f:facet name="header">
<h:commandLink actionListener="#{prijaviIspit.sortZbor}" >
<h:graphicImage value="/media/indeks.jpg" styleClass="slikiLinkovi" />
</h:commandLink >
</f:facet>
<h utputText value="#{e.MK}"/>
</h:column>
</h ataTable>

</h anelGrid>
 
darko kalevski
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or if someone has ran into suck issue and is willing to discuss it PLEASE let me know!

or eventually point me to some documents where I can read how I can do it?

its REALLY important to me! a thesis project!

thanks!
 
Aditya Tallapally
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also in the same situation.
I would like to retrieve data from multiple tables for which i have a complex sql. But I am not sure whether I can write sql in the Managed bean at the back end or come up with separate class?
If so can i get some example?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
karttikea

Welcome to Javaranch! We don't have too many rules around here but we do have a Naming Policy. Please adjust your display name accordingly.

Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!