• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

quoting in queries

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys...juz a simple qn...is jsp case sensitive?

and

String queryText = "insert into sshl values(\"" + request.getParameter("employee_name") + "\");";


String queryText = "insert into sshl values('" + request.getParameter("employee_name")";"

which one is right and wrong? or is both acceptable
[ August 04, 2004: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, JSP, like Java, is case-sensitive.

And since your other question is not a JSP question, I'm moving it to the JDBC forum (with an appropriate change of title).
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's a syntax error in your second example, so that one's wrong.

To answer your real question, I would always use single quotes when writing SQL queries as not all RDBMS support double quotes. I'm not sure what the ANSI standard says about it.

From a JDBC perspective I'm not sure if it matters as I believe the query string will be processed by the JDBC Driver implementation before being passed on the database in a compatible format. I suppose the degree of processing that takes place would depend on the driver.

Anyway, hope that answers your question.

Jules
 
mary bate
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic