InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples

CVS Repositories

Who We Are
News, Articles & Events
Getting Involved
Contact Us

Case Studies
On The Edge! -NEW-
Commercial Vendors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: InstantDB: Embedded Quotes


Thanks for the explanation!


>For reasons that even I can't figure out, InstantDB always assumes that you
>don't want the external quotes or double quotes on a string literal. But as
>you've discovered, it doesn't understand the escape sequence \" unless it's
>actually inside a literal. The result of this is that InstantDB has to get
>quoted string with quotes inside of it. Which translates to the following
> (pretty horrible) sequence:
>p.setString (1,"\"\\\"name2\\\"\"");
>What does all that mean? The outer quotes and triple \ are for the Java
>compiler's benefit. So what InstantDB sees is:
>InstantDB assumes you don't want the outer quotes so it parses this as the
>string literal:
>As it's now inside of a string literal, it will accept the \" escape
>sequence and you finally end up with what you wanted, i.e.:
>I think the best long term solution here would be for InstantDB to
>the \" sequence outside of string literals. In which case you would only
>have to provide the slightly less awkward:
>p.setString (1,"\\\"name2\\\"");
>For the moment though, I'm afraid you're stuck with the above solution.
>Peter Hearty
>Lutris Technologies (UK)
>----- Original Message -----
>From: "Gary Myers" <>
>To: <>
>Sent: Wednesday, August 30, 2000 10:32 PM
>Subject: InstantDB: Embedded Quotes
> I have an application that uses PreparedStatements, which 99% of the time
> works great with embedded quote (") and single-quote (') characters
> doing any explicit escape sequences.
> The 1% is where I have a problem.  If the setString() call on my prepared
> statement starts with a quote (") or single-quote (') character, InstantDB
> skips it and goes to the next character.  Obviously, this starting quote
> character is very important to my application.  I have tried prepending a
> slash to the string, but InstantDB then complains with:
> Unknown escape character: \
> My code (snippet of):
> PreparedStatement stmt = conn.prepareStatement(
> s = file://someString;
> // if it starts with a quote or single-quote, prepend the slash
> c = s.charAt(0);
> if (c == '"')
> {
> s = "\\" + s;
> // I even tried
> // s = "\\\"" + s.substring(1);
> }
> else if (c == '\'')
> {
> s = "\\" + s;
> }
> stmt.setString(1, s);
> Any help or suggestions?
> Thanks.
> Gary Myers

To unsubscribe from this mailing list, send email to
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at