Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with a switch

 
Laurent Quenon
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I'm sure what I'm asking is realy stupid but it's already a long time I'm looking for a solution without any success, so I hope that somebody will be able to point out my mistake.
I have the following code:
public Map queryDB (String args[], int swKey)
{
String querystring;
switch(swKey)
{
case 1:
querystring = "SELECT * FROM Player";
break;
}
When I try to add an instruction after this switch it looks that everything is unresolvable. Indeed I don't have the automatic completion anymore and if I try to use query string it says that it cannot be resolved.
Thanks a lot for your help.
And sorry again if it's just too obvious for most of the people here.
Merry Christmas and Happy New Year.
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please post the code that you are having problems with? This code in itself seems to be fairly straightforward, so I think that we could only help if we can see code that has the problem.
Thanks,
 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Laurent Quenon:
Hello all,
I'm sure what I'm asking is realy stupid but it's already a long time I'm looking for a solution without any success, so I hope that somebody will be able to point out my mistake.
I have the following code:
public Map queryDB (String args[], int swKey)
{
String querystring;
switch(swKey)
{
case 1:
querystring = "SELECT * FROM Player";
break;
}
When I try to add an instruction after this switch it looks that everything is unresolvable. Indeed I don't have the automatic completion anymore and if I try to use query string it says that it cannot be resolved.
Thanks a lot for your help.
And sorry again if it's just too obvious for most of the people here.
Merry Christmas and Happy New Year.


Hi Laurent, Your question seems a little bit short. My guess is that you forget a braclet }. If you post the entire code block then maybe we'll be able to help more.
 
Laurent Quenon
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't worry I think it's just a bug in Eclipse...
I didn't change anything I just closed and restart Eclipse (not even save, it was already saved before) and now it works perfectly.
Sorry to bother you,
But thanks again.
Merry Christmas and Happy New Year.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic