I found a peculiar problem when i tried retrieving values from a table using JDBC.
I had 2 parts of a queries separated by UNION. When i used the m$ sql comment "--" in the first part of the query, the code after union did not get executed. Say for example:-
sbSample.append("select 'abcd', 'efgh'");
sbSample.append("--order by 1");
union
sbSample.append("select 'ijkl', 'mnop'");
(sbSample is a StringBuffer type)
then executing the query using create statement to follow.
the result was
abcd
efgh (assume that i printed the result in some loop)
I have not tried any other combination yet.
Explanation/tips on how to observe this more detailed are highly welcome.