Thanks for that. Here is a code snippet where I'm trying to use the vector of
vectors thing as you suggested. Any tips on why this doesnt work?
java.util.Vector calPackage = new Vector();
while (rs.next()) {
java.util.Vector CalItem = new Vector();
lim = lim +1;
CalItem.addElement(rs.getString("EVENT_ID"));
CalItem.addElement(rs.getString("USER_ID"));
CalItem.addElement(rs.getString("START_DATE"));
CalItem.addElement(rs.getString("END_DATE"));
CalItem.addElement(rs.getString("REOCCURING_ID"));
CalItem.addElement(rs.getString("MESSAGE_TEXT"));
calPackage.addElement(CalItem);
}
for(int i = 0; i<calPackage.size();i++){
java.util.Vector CalItem = (Vector)calPackage.elementAt(i);
java.util.Vector misc = (Vector)CalItem.elementAt(i);
String item = misc.elementAt(i);
out.print (item);
}
>2. The simplest way is, when you retrieve the data from database you can
>iterate through the resultset where you store your data and then place it on
>a vector. By using vector we will reduce our connection time with database
>so this can speedup our application.
>
>for examples:
>
>public Vector List() {
> String strSql = "SELECT * FROM BROKER_DEPT WHERE BROKERID =
>'"+BrokerId.toUpperCase()+"' ORDER BY DEPTID ASC";
> ResultSet rs = SQLQuery(strSql);
>
> Vector result = new Vector();
> try {
> while (rs.next()) {
> DepartmentDB items = new DepartmentDB();
> items.setDeptId(rs.getInt("DEPTID"));
> items.setBrokerId(rs.getString("BROKERID"));
> items.setDescription(rs.getString("DESCRIPTION"));
> result.addElement(items);
> }
> rs.getStatement().close();
> }
> catch (SQLException sqle) {
> System.out.println("DEPT::List "+sqle.getMessage());
> }
> return result;
>}
>
>public class DepartmentDB {
>
> public DepartmentDB() {
> }
>
> private int DeptId;
> private String BrokerId;
> private String Description;
>
> public void setDeptId(int DeptId) {
> this.DeptId = DeptId;
> }
> public void setBrokerId(String BrokerId) {
> this.BrokerId = BrokerId;
> }
> public void setDescription(String Description) {
> this.Description = Description;
> }
>
> public int getDeptId() {
> return this.DeptId;
> }
> public String getBrokerId() {
> return this.BrokerId;
> }
> public String getDescription() {
> return this.Description;
> }
>
>}
>
>-----Original Message-----
>From: Kate McNamara [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, September 21, 2000 10:05 AM
>To: [EMAIL PROTECTED]
>Subject: Some questions...(Vectors / WML / Browsers)
>
>
>> I'm posting this again because it appears to have been rejected the first
>time.
> Apologies to anyone who might receive it twice.
>
>
>Hi Folks,
>
>I was hoping someone might be able to help me with the two problems I'm
>having
>
>at the moment.
>
>1/ I want to detect a WAP browser (as opposed to any standard PC browser)
>and
>
>redirect to a different welcome page accordingly. At the moment if I try to
>
>type in my WML address in IE, it tries to download the resulting file. Not
>
>a good idea. Also, I am trying to build the WAP using JSPs. Is there a
>content
>
>type command I can use to allow it to be delivered appropriate (ie as WML)?
>
>
>
>2/ I'm limited to Java 1.1.*, and I'm using a lot of databases. I want
>to be
>able to move through one resultset several times, and I've been told that
>the
>
>best way to achieve this is through vectors (or vectors of vectors). I'm
>not
>
>sure of the syntax of this, so if anyone could assist I would greatly
>appreciate
>
>it.
>
>Thanks very much!
>
>Kate McNamara
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>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".
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