• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing data fields a different way  RSS feed

Posts: 7
  • Mark post as helpful
  • send pies
  • 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">
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:getProperty name="findDocExist" property="DOC_ID" />
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
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!