| Author |
resource file - add quotes around param
|
Chris Montgomery
Ranch Hand
Joined: Jan 14, 2004
Posts: 141
|
|
I have a resource file (x.properties) that I'm storing all my sql statements in. how do I get single quotes around a parameter in my properties file? properties file: test.sql=SELECT * FROM member WHERE member_name={0} How do I get the above to output this: SELECT * FROM member WHERE member_name='CHRIS' I've tried: test.sql=SELECT * FROM member WHERE member_name='{0}' and : test.sql=SELECT * FROM member WHERE member_name=\'{0}\' but both return SELECT * FROM member WHERE member_name={0} rather than what I want. perhaps my approach is wrong... Thanks!
|
 |
Brian Duff
Greenhorn
Joined: Aug 16, 2001
Posts: 22
|
|
If you're passing those resources into MessageFormat.format(), you need to use two single quotes, e.g.
|
 |
Chris Montgomery
Ranch Hand
Joined: Jan 14, 2004
Posts: 141
|
|
Perfect! Thanks Brian. Chris
|
 |
 |
|
|
subject: resource file - add quotes around param
|
|
|