user267324
user267324

Reputation: 63

How to add SQL on multiple lines in - SQL.properties file

JEE Project - Separating SQL from code: I have SQL in my sql.properties file like this .. on 4 lines.

emp_sql=select * \  
from employees \  
  where \   
name = 'JON' 

The loader sees only first line - rest of the lines are being ignored. what am I doing wrong. thanks.

Upvotes: 1

Views: 2086

Answers (2)

Bibin
Bibin

Reputation: 434

If you keep the properties file as xml then this multiline issue wont arise. You should use loadFromXML method of java.util.Properties. Please note that this feature is available only from 1.5. Check out the following link

Upvotes: 0

Jim Garrison
Jim Garrison

Reputation: 86774

Check to make sure there are no blanks after the \ backslashes at the end of each line. A blank in the position cancels the effect of the backslash.

Upvotes: 3

Related Questions