tags:

views:

57

answers:

1

I have a problem executing queries having comments via JDBC. Can you help us?

This works:

select * from notf_worklist; SELECT * FROM NOTF_TASK_INSTANCE

The following query throws an error: "Error :com.microsoft.sqlserver.jdbc.SQLServerException: The index 1 is out of range. ErrorCode:0 SQLState:S1093"

select * from notf_worklist; -- SELECT * FROM NOTF_TASK_INSTANCE

We are trying SQL injection testing.

A: 

Can you show the code you are using to execute this query? The error doesn't seem to be related to your query.

matt-dot-net
I cannot share the code here as we have an abstraction over JDBC. We convert the query from xml to sql and then execute via JDBC. By the way if i just remove the comments it works. SO definitely there is something goin wrong in parsing when the query has multiple statements with comments
Siddharth