Hi Todd,

You created array. Now you have to fill this array with StringBuffer
objects.

for (int i = 0; i < 10; i++)
   varSQLStatement[i] = new StringBuffer();

After that you can call append() method.

Igor.


-----Original Message-----
From: Todd Trent [mailto:[EMAIL PROTECTED]]
Sent: May 10, 2002 3:38 PM
To: JDJList
Subject: [jdjlist] StringBuffer array


Hi,

I'm a newbie looking for some help. How would I go about creating a
StringBuffer array?

I am trying to create 10 SQL statements with data collected from a JSP form.
Each SQL statement is either an insert or update statement depending on
whether a record already exists in the database. I want to run through a for
loop 10 times in order to append the field data to my StringBuffer array.

   <%
   int i;
   StringBuffer[] varSQLStatement = new StringBuffer[10];

   for (i=9; i>=0; i--) {

       varSQLStatement[i].append("INSERT INTO")


My code does compile, but I can't seem to get any data into the StringBuffer
array.

   <%=varSQLStatement[9]%> = null

Does anyone have any suggestions?...aside from looking for alternative
career. :-)

Thanks,
Todd


To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm


To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to