Hi Larry,
This is obviously totally a database design issue and you are
essentially creating your own proprietary format. See
java.util.StringTokenizer for a solution to your parsing problem.
I sympathize and agree with Milt's feelings regarding these questions,
but JDBC/database issues are probably more intertwined with servlets than
any other general java area. Does anyone else ( especially at Sun ) agree
that a JDBC/database list and a Sun sponsored general java list ( not to run
down the advanced java list at all ) would be welcome additions?
Joe Sam Shirah
Autumn Software
-----Original Message-----
From: Larry Linville <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, September 01, 1999 9:23 PM
Subject: Parsing Question
First off, I got a number of servlets that must communicate with
my database, and I'm currently using JSDK 2.0.
In retrieving a series of columns (or record) from a particular table
one of my columns is returning a string value of "1,2,3,4".
Now "1,2,3,4" is the correct entry for the column, but its really supposed
to be (4) values saved in the same column or string. Now, after having
"1,2,3,4"
in my result set, how do I parse it out to say 1 = ? , 2 = ? , 3 = ?, 4 = ?
etc... From there I'm looking to println("Value 1 = " + stringValue1);
println(Value 2 = " + stringValue2); etc
So, I'm looking to divide the different individual values out of my original
string so that I can give each value its own println or value.
I could put each of the values into their own columns and
then not worry about having to divide things up.. but in having those
values range from 1 to 50 while being pretty closely related I don't
think I want to do that. Also, all my records may have a different
combination or order for those values.
Thanks...
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html