Ibatis can't query v$ tables... Won't pass $ character.
746381Jan 18 2010 — edited Jan 18 2010Hello,
I hope this is the right forum.
I'm trying to do some coding in Java to monitor a lock. I have a tool built that takes SQL and applies logic sort of a multi tool so I never have to write code anymore to do the things that I want to do in our systems - just string together multiple runs of this app and catch the error codes.
Anyways, I'm trying to monitor locks in the database under certain conditions but I'm not able to get Ibatis to query against v$ tables.
If I put 'select * from v$lock' into Ibatis, it will come out 'select * from vlock' which causes an ORA-000942: table or view does not exist error.
Actual log from my app:
+DEBUG [main] (Log4jImpl.java:26) - {conn-100000} Preparing Statement: select nvl(( select '1' from vlock vlock2 where 1=1 and vlock1.block=1 and vlock1.id1=vlock2.id1 and vlock1.id2=vlock2.id2 and 0 < vlock2.request and rownum=1), '0') as results from dual+
+DEBUG [main] (Log4jImpl.java:26) - {pstm-100001} Executing Statement: select nvl(( select '1' from vlock vlock2 where 1=1 and vlock1.block=1 and vlock1.id1=vlock2.id1 and vlock1.id2=vlock2.id2 and 0 < vlock2.request and rownum=1), '0') as results from dual+
+DEBUG [main] (Log4jImpl.java:26) - {pstm-100001} Parameters: []+
+DEBUG [main] (Log4jImpl.java:26) - {pstm-100001} Types: []+
+DEBUG [main] (Log4jImpl.java:26) - Returned connection 1156596976 to pool.+
+ERROR [main] (Main.java:101) - com.ibatis.common.jdbc.exception.NestedSQLException:+
--- The error occurred in jdasql.xml.
--- The error occurred while applying a parameter map.
--- Check the -existf_AsdLockCheck2-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-00942: table or view does not exist
It's strange. The sqlmap actually has this:
select nvl((
select '1'
from v$lock vlock1
+, v$lock vlock2+
where 1=1
and vlock1.block=1
and vlock1.id1=vlock2.id1
and vlock1.id2=vlock2.id2
and 0 < vlock2.request
and rownum=1), '0') as results from dual