Wow! Mabye is just a normal binder variable, but with 2 lines! The java.sql.Conneciton documentation (quick read) says nothing that they should be separated by spaces. Please write more code so we can see if there are any setString calls to add binding variables (s).
For example, something like this:
pstmt = conn.prepareStatement("select blah from blah WHERE phid = ??id and blah blah"); pstmt.setString(1, "customer_"); pstmt.setString(2, "order_");
I have never seen anything like it, but maybe this is what they did?
EDIT: I tried! And that gave me a mistake! I wonder if you found some dead code? This is what I tried:
sql.append("SELECT A.ID, A.GROUP_NUMBER, A.GROUP_NAME "); sql.append("FROM " + tab1 + " A "); sql.append("INNER JOIN " + tab2 + " B "); sql.append("ON (A.ID = B.GROUP_ID) "); sql.append("WHERE B.THREAD_ID = ? "); sql.append("AND B.THREAD_ID = ??ID "); sql.append("ORDER BY A.ID "); // ... conn = getConn(); pstmt = conn.prepareStatement(sql.toString()); pstmt.setInt(1, threadId); pstmt.setString(2, "B."); pstmt.setString(3, "THREAD_");
I got this error:
ILLEGAL SYMBOL "?". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: MICROSECONDS MICROSECOND SECONDS SECOND MINUTES MINUTE HOURS. SQLCODE=-104, SQLSTATE=42601, DRIVER=3.57.82
Jess
source share