• Post Reply Bookmark Topic Watch Topic
  • New Topic

"String literal is not properely closed by a double quote" error.

 
WeiJie Lim
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Eclipse highlighted the portion in red with the error. I seriously can't find what is the issue with the double quotes. Any help is appreciated .
 
Tim Cooke
Sheriff
Posts: 3293
153
Clojure IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The compiler is being pretty clear about the problem. You have an open ended String literal.

I'd suggest backing off on the complexity of this line and start at the simplest code that works (compiles) and add little bits incrementally. So start with the simplest code that works:

Does it compile? Good. Then add a little bit

Does it compile? Good. Then some more

Does it compile? Good. Now add your input param with the single quotes

Still compiling? Good. Now continue to work like this to add in the rest of the input params you need. Chances are you won't see this compiler error again.

As an aside. It's pretty likely you would be brought up on this by other Ranchers too but a JSP is no place to be dealing with sql ResultSets. ResultSets are a convenience provided by the Java JDBC library for marshalling data out of a database and you should process the data out of them into your own objects and close them as soon as possible. JSP's are a presentation technology, so we should not be dealing with Database access technologies within them. The context is all wrong.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!