Hi,

for example:

CREATE TABLE City (   ID INT(11),   Name CHAR(35),   CountryCode CHAR(3),   District CHAR(20),   Population INT(11),   PRIMARY KEY (ID, CountryCode) ) WITH "template=partitioned, backups=1, affinityKey=CountryCode, CACHE_NAME=City, KEY_TYPE=demo.model.CityKey, VALUE_TYPE=demo.model.City";

INSERT INTO City(ID, Name, CountryCode, District, Population) VALUES (1,'Ka'bul','AFG','Kabol',1780000);

name field's value contains single quotes.

The following writing will throw exceptions:

INSERT INTO City(ID, Name, CountryCode, District, Population) VALUES (1,'Ka\'bul','AFG','Kabol',1780000);

INSERT INTO City(ID, Name, CountryCode, District, Population) VALUES (1,'Ka\\'bul','AFG','Kabol',1780000);

INSERT INTO City(ID, Name, CountryCode, District, Population) VALUES (1,"Ka'bul",'AFG','Kabol',1780000);

I wonder if there are any other solutions besides the PreparedStatement?


Reply via email to