0

I am setting the value of String something like this:

ps.setString(1, "'Schema.tablename.Columnname','Schema.tablename.ColumnName'"); 

Then the prepared statement is setting the value as a blank string ('').

Do I need escape characters here? I tried escaping the characters, but it is not working.

Pierre Arnaud
  • 10,212
  • 11
  • 77
  • 108
Sivanagaiah
  • 153
  • 3
  • 10

1 Answers1

0

if you need single quote then do it as follows

ps.setString(1, "''Schema.tablename.Columnname'',''Schema.tablename.ColumnName''");

if don't need single quote then remove them

ps.setString(1, "Schema.tablename.Columnname,Schema.tablename.ColumnName");

Make sure you remove all single quotes if you dont want them. if want them then make sure for each single quote add extra single quote.

Jitendra Vispute
  • 709
  • 8
  • 18