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]

InstantDB: Unable to turn off escape character in Statement


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(, Compiled Code)
        at org.enhydra.instantdb.db.tokenList.parseTokens(, Compiled Code)
        at org.enhydra.instantdb.db.tokenList.<init>(, Compiled Code)
        at org.enhydra.instantdb.db.SQLProg.<init>(
        at org.enhydra.instantdb.jdbc.idbStatement.execute(, Compiled Code)
       at org.enhydra.instantdb.jdbc.idbStatement.executeQuery(
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.


; 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;