• Post Reply Bookmark Topic Watch Topic
  • New Topic

Retrieval of data from microsoft sql to pass into an array of String

 
Sandy Goh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
need help here. grateful for any suggestions..
I need to retrieve values from microsoft sql which i will use
<%String myvalue=rst.getString("value");%>
after that i need to pass those values into an array of strings but i'm clueless abt how to go about doing it.
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you asking about how to write a SQL query to do that, or how to create an array of strings from a String object?
 
Sandy Goh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both.. Thanks.
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well for the SQL query you should ask in the JDBC forum.
To create an array of string from a string, you could do this a variety of ways. Have a look at StringTokenizer. You can break up a delimeted string into individual tokens and use them to initialize the elements of a string array. But that is more of a general Java question, not really a JSP question. For that, you can try asking in the Java-In-General formum. Try the Beginner forumfirst; if they can't answer it they will transfer the question to a more advanced forum.
Good luck!
 
Sandy Goh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob. I got what I want.
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For breaking a string up into an array of strings, take a look at String.split() .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!