How do you work around this scenario. I need to call 5 different queries
from my DataAccessBean and display the results in a table. When you say save
the results in another structure how can I run these queries separately and
get different results each time. The queries have the same filed name in
different tables, for instance "Description" and "Name". The code below is
what I am running.
<jsp:useBean id="db" scope="page" class="DataAccessBean"/>
<%!
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String url = "jdbc:odbc:security";
%>
<%
ResultSet showdb = db.getApplications(driver,url);
while (showdb.next()){
out.println(showdb.getString("Name"));
}
if (showdb != null) showdb.close();
%>
<%
ResultSet showResources = db.getResources(driver,url);
while (showResources.next()){
out.println(showResources.getString("Name"));
}
%>
----- Original Message -----
From: "Jann VanOver" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 07, 2001 10:09 PM
Subject: Re: Rogue url
| Yeah, Bryan, I found this one out the hard way, too. Many (most?) db
| drivers require you to get each field just once and TO GET THEM IN THE
SAME
| ORDER as they appeared in the SELECT statement. It is often advisable to
| loop through the result set once and save the data into your own class or
| other data structure.
|
| Also, we found out the hard way, that accessing a column BY NAME had
SERIOUS
| performance implications (we were using Weblogics db drivers at the time).
| We had to get columns by position (getString(1) instead of
| getString("fldName")) to reach our performance goals.
|
| -----Original Message-----
| From: Bryan LaPlante [mailto:[EMAIL PROTECTED]]
| Sent: Saturday, July 07, 2001 7:55 AM
| To: [EMAIL PROTECTED]
| Subject: Re: Rogue url
|
|
| Call me confused. I have resolved the problem by moving to the top of my
| ResultSet loop and declaring local variables to hold the value of each
| column during the loop. The problem seems to be if I use the syntax
| <%=showdb.getString("anyColumn")%> more than once in the same iteration of
| the loop it will throw a Java.sql.SQLException. Am I to assume that after
a
| reference to the column value has been made that the ResultSet no longer
has
| that value?
|
| What is it that I don't understand here, Anybody?
|
| Bryan
|
| ----- Original Message -----
| From: "Bryan LaPlante" <[EMAIL PROTECTED]>
| To: <[EMAIL PROTECTED]>
| Sent: Saturday, July 07, 2001 9:16 AM
| Subject: Rogue url
|
|
| | Hi,
| |
| | I need a second pair of eyes on this line of code. I am trying to create
| an
| | anchor tag with the following url.
| |
| | NewApp.cfm?name=<%= showdb.getString("Name"); %>&description=<%=
| | showdb.getString("Description") %>&appID=<%=
| | showdb.getString("ApplicationID") %>
| |
| | When this line is commented out the loop around it runs fine displaying
| all
| | of the ResultSet. When I run this line of code I get a
| | java.sql.SQLException. Can anybody see what I am doing wrong?
| |
| | NT4 sp6
| | JRun3.0
| | IIS4
| |
| | Bryan LaPlante
| | 816-347-8220
| | [EMAIL PROTECTED]
| | http://www.netwebapps.com
| | Web Development
| |
| |
|
===========================================================================
| | To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
| JSP-INTEREST".
| | For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
| DIGEST".
| | Some relevant FAQs on JSP/Servlets can be found at:
| |
| | http://java.sun.com/products/jsp/faq.html
| | http://www.esperanto.org.nz/jsp/jspfaq.html
| | http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
| | http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
| |
|
|
===========================================================================
| To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
| JSP-INTEREST".
| For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
| DIGEST".
| Some relevant FAQs on JSP/Servlets can be found at:
|
| http://java.sun.com/products/jsp/faq.html
| http://www.esperanto.org.nz/jsp/jspfaq.html
| http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
| http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
|
|
===========================================================================
| To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
| For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
| Some relevant FAQs on JSP/Servlets can be found at:
|
| http://java.sun.com/products/jsp/faq.html
| http://www.esperanto.org.nz/jsp/jspfaq.html
| http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
| http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
|
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets