database - Using alias with spaces in between in an SQL statement inside of ECLIPSE IDE -


resultset rs = stmt.executequery= (" select column1 string space ex employee name table1  condition1 = condition "); 

if use alias no space work, in case need alias spaces between words. how do when entire sql statement in string?

the typical way use escape character. in other words, tell compiler follows part of string, not end of string itself. example, entering "she told me "i didn't hear you" face." compiled "she told me " plus nonsense i didn't hear you plus final string " face." escape characters, write "she told me ""i didn't hear you"" face." in case double quote, depends on compiler talking to. try this:

resultset rs = stmt.executequery= (" select column1 ""string space"" ex employee name table1  condition1 = condition "); 

really though, recommend use underscores or no spaces. in experience, everything harder on , else works on after when have fight column aliases.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -