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