• Post Reply Bookmark Topic Watch Topic
  • New Topic

Parse data from a db column.  RSS feed

 
John Tyll
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a java notification app. It works just fine but, requirements changed. Currently, I am selecting the data from an Oracle table that is necessary to send an e-mail, the subject, body, and column E_ADDRESS, which contains 1 e-mail address. The new requirement is to allow this E_ADDRESS column to contain 1 - 5 e-mail addresses. I am not sure how I parse out this data, and I don't seem to find an example on-line. Please help.
 
Greg Charles
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need some way to delimit e-mail addresses, e.g. a comma. Whoever creates the data record, must place a comma between e-mail addresses stored in a single field. You then read the whole string in the e-mail address column and use a StringTokenizer to chop it up into individual addresses.
Another solution: don't store multiple e-mail addresses in one column. Have an e-mail address table indexed to your main table. I know though, you don't always have influence over your data model. We've all been there! :roll:
[ February 06, 2003: Message edited by: Greg Charles ]
 
John Tyll
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thnaks Greg,
It helps to know what to look for.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!