Make your own free website on Tripod.com

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

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


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

Re: InstantDB: Unable to turn off escape character in Statement


Pierre-Yves

I'm not really sure why this problem is happening. I ran the little test
script that you were good enough to provide and it seemed to run OK.

If you were writing a similar query inside a Java program then you'd have to
double the number of backslashes, i.e.

"SELECT uid FROM login WHERE name = 'testAc\\\\=coun=t1'"

so that the Java compiler could escape the escapes, but you probably already
know that.

> Is Statement.setEscapeProcessing() supported by InstantDB?

Yes - but I don't think it does anything.

> Should I rather use a PreparedStatement?

You could try. The prepareIgnoresEscapes=0 property setting in the database
.prp file would then come in useful.

If none of the above helps then get back to me and I'll scratch my head a
bit more.

Regards

Pete

--

Peter Hearty                         peter.hearty@lutris.com
Lutris Technologies (UK)        http://www.lutris.com
----- Original Message -----
From: "Pierre-Yves Chevalier" <Pierre-Yves.Chevalier@mkms.xerox.com>
To: <instantDB@enhydra.org>
Sent: Monday, October 23, 2000 3:59 PM
Subject: InstantDB: Unable to turn off escape character in Statement


> Hi,
>
> I'm trying to perform a simple SELECT based on a weird value:
> "testAc\\=coun=t1". My query turns to be:
>
>      SELECT uid FROM login WHERE name = 'testAc\\=coun=t1'
>
> I did turn off escape processing both in the prop file as suggested by
> Bill Karwin and within my own code: stmt.setEscapeProcessing(false);
>
> In both cases, I got the following exception:
>
>      java.sql.SQLException: Unknown escape character: \= (Thread:
>      main, at:Mon Oct 23 17:38:10 CEST 2000)
>      java.sql.SQLException: Unknown escape character: \=
>              at
>      org.enhydra.instantdb.db.tokenList.classifyChar(tokenList.java,
>      Compiled Code)
>              at
>      org.enhydra.instantdb.db.tokenList.parseTokens(tokenList.java,
>      Compiled Code)
>              at
>      org.enhydra.instantdb.db.tokenList.<init>(tokenList.java,
>      Compiled Code)
>              at
>      org.enhydra.instantdb.db.SQLProg.<init>(SQLProg.java:130)
>              at
>      org.enhydra.instantdb.jdbc.idbStatement.execute(idbStatement.java,
>      Compiled Code)
>             at
>
org.enhydra.instantdb.jdbc.idbStatement.executeQuery(idbStatement.java:91)
>
>
>
> Is Statement.setEscapeProcessing() supported by InstantDB?
> Should I rather use a PreparedStatement?
> I would appreciate a bit of help there.
>
> Thanks in advance and keep up the good work.
> --Pitch
>
>
>
>      ; First load the JDBC driver and open a database.
>      d org.enhydra.instantdb.jdbc.idbDriver;
>      o jdbc:idb=sample.prp;
>
>      ; Create the table and its index
>      e DROP TABLE testescape;
>      e CREATE TABLE testescape (
>       id   int PRIMARY KEY,
>       fullName  CHAR(80) );
>
>      ; put some initial data in the table
>      e INSERT INTO testescape VALUES (1,"Alice");
>      e INSERT INTO testescape VALUES (2,"Bob");
>      e INSERT INTO testescape VALUES (3,"testAc\\=coun=t1");
>
>      q SELECT id FROM testescape WHERE fullName = "Alice";
>      q SELECT id FROM testescape WHERE fullName =
>      "testAc\\=coun=t1";
>
>      c close;
>
>

-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
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 owner-instantdb@enhydra.org.