It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes Accessing data fields a different way Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Accessing data fields a different way" Watch "Accessing data fields a different way" New topic

Accessing data fields a different way

Tony Huynh

Joined: Aug 21, 2001
Posts: 7
Hi all,
I usually access and display my data fields like so..
This is my connetion tags:
<tsx:dbconnect id="myDbConnection"<br /> driver=""<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
I agree. Here's the link:
subject: Accessing data fields a different way
It's not a secret anymore!