• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing data fields a different way

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I usually access and display my data fields like so..
This is my connetion tags:
<tsx:dbconnect id="myDbConnection"<br /> driver="COM.ibm.db2.jdbc.app.DB2Driver"<br /> url="jdbc:db2:my_database"<br /> userid="userid"<br /> passwd="password">
</tsx:dbconnect>
The SQL query:
<tsx:dbquery connection="myDbConnection" id="findDocExist">SELECT DOCUMENT.DOC_ID AS DOC_ID FROM DOCUMENT WHERE DOC_LOCATION = '<%=doc_location%>'</tsx:dbquery>
The results are displayed by the following:
<tsx:repeat>
<tsx:getProperty name="findDocExist" property="DOC_ID" />
</tsx:repeat>
That's all fine but what I really want is to grab the doc_id from the database and use it in my scriptlets (comparing ids). I don't think I can use these tags in my scriplets... it just comes up with a bunch of errors!
For example I've been doing this:
<% if ( %><tsx:repeat><tsx:getProperty name="findDocExist" property="DOC_ID" /></tsx:repeat><% == request.getparameter("doc_location") { %><br /> The Document you specified in document location: <%=request.getParameter("doc_location")%> already exists!<br /> <br /> Please enter another location!<br /> If anyone know how I can access my data using scriptlets instead of this tag format please reply. Thanks in advance!!!<br /> -Tony
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic