This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC 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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Accessing data fields a different way" Watch "Accessing data fields a different way" New topic
Author

Accessing data fields a different way

Tony Huynh
Greenhorn

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="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
 
wood burning stoves
 
subject: Accessing data fields a different way
 
Similar Threads
Hibernate relationl table with aditional column
tsx:dbquery gives JSP compilation error !
why is my loginForm stopped processing the user input
Hibernate Association table - extra column
405 Method Not Allowed - WebSphere