May 04, 2012 · Tim Rohaly. In JDBC, strings containing SQL commands are just normal strings - the SQL is not parsed or interpreted by the Java compiler. So there is no special mechanism for dealing with special characters; if you need to use a quote (") within a Java string, you must escape it. ASCII code Single quote or Apostrophe, American Standard Code for Information Interchange, ASCII table, characters, letters, vowels, consonants, signs, symbols, 20200227
Single quotation marks delimit character strings. Within a character string, to represent a single quotation mark or apostrophe, use two single quotation marks. (In other words, a single quotation mark is the escape character for a single quotation mark.) A double quotation mark does not need an escape character. Introduction: In previous articles i explained How to Convert Rupees,Currency or Numbers to Words in Asp.net and Create crystal reports in visual studio 2010 and How to create and consume WCF Services and How to Split large string separated by comma in Sql Server and Backup and restore sql server database and Convert/downgrade SQL Server 2012,2008 database to SQL Server 2005 or lower version .
Ken, I've just tried testing this, and can't repeat it. If I pass that string to Connection.nativeSQL() (which runs it through the escape processor), I get it back. The escape processor code doesn't even know about the sql_mode of the server, so I'm a bit stumped. Advertiser Disclosure: Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear.