• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bring a value Outside of the loop  RSS feed

 
Sam Saha
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am very new in Java Programming and I need your help to solve one thing. I have a string of Integers and I am parsing the string using String tokenizer and from the database I am getting the corresponding string from database. I am appending all strings together. Now I want to bring this Final full appended String outside so that I can use it anywhere in the same class wherever I want.

Example:

Str = 1234567895

I am parsing like 12, 34, 56, 78, 95
From Database I am getting “a” [for 12], “b” [for 34], “c” [for 56], “d” [for 78], “e” [for 95]

I am getting now
“a”, “b”, “c”, “d”, “e”

I am concatenating them to make a full string like “abcde”

Now I want to bring this string outside so that I can compare this string with other values of the same class.
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain what that is supposed to do. Also how long does that loop run for?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What String is there you want to "bring outside the loop"? The only Strings I see are "str" and "sql". The former isn't in a loop, and the later seems pretty pointless to "bring out".
 
Sam Saha
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically I am trying to secure an backend API call API call. The FrontEnd is sending the backend API the username as an input parameter for the backend API to secure that API. The Frontend is encoding the actual username into number and sending it. Now the backend API is first parsing the number into substring and converted into integer and then picking up the correponding characters from the table and then appending them to get the username. Now after appending this I have to verify this username with the username from another table in the backend and if they are same we will allow the API to return the value to the front end. Here we are using basically the duplicate same table in the front end and back end. I am new to the java development and I need your help on this. Thank you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!